\echo ###### GROUPING SETS
explain (analyze on, buffers on, verbose on, format :format)
SELECT a, b, max(c) FROM tt1 GROUP BY GROUPING SETS ((a), (b), ());
+\echo ###### Table sample
+explain (analyze on, buffers on, verbose on, format :format)
+ SELECT * FROM tt1 TABLESAMPLE system(1) REPEATABLE (1);
-- BitmapAnd/Inner/Right/ForegnScan
{P_ConfArbitIdx, "@" ,"Conflict Arbiter Indexes",NULL, false, NULL, SETTER(conflict_arbiter_indexes)},
{P_TuplesInserted, "^" ,"Tuples Inserted", NULL, false, NULL, SETTER(tuples_inserted)},
{P_ConfTuples, "+" ,"Conflicting Tuples", NULL, false, NULL, SETTER(conflicting_tuples)},
+ {P_SamplingMethod, "" ,"Sampling Method" , NULL, false, NULL, SETTER(sampling_method)},
+ {P_SamplingParams, "" ,"Sampling Parameters" , NULL, false, NULL, SETTER(sampling_params)},
+ {P_RepeatableSeed, "" ,"Repeatable Seed" , NULL, false, NULL, SETTER(repeatable_seed)},
{P_Invalid, NULL, NULL, NULL, false, NULL, NULL}
};
P_ConfRes,
P_ConfArbitIdx,
P_TuplesInserted,
- P_ConfTuples
+ P_ConfTuples,
+ P_SamplingMethod,
+ P_SamplingParams,
+ P_RepeatableSeed
} pgsp_prop_tags;
typedef struct
LIST_SETTER(conflict_arbiter_indexes);
DEFAULT_SETTER(tuples_inserted);
DEFAULT_SETTER(conflicting_tuples);
-
+DEFAULT_SETTER(sampling_method);
+LIST_SETTER(sampling_params);
+DEFAULT_SETTER(repeatable_seed);
#define ISZERO(s) (!s || strcmp(s, "0") == 0 || strcmp(s, "0.000") == 0 )
#define HASSTRING(s) (s && strlen(s) > 0)
print_prop_if_exists(s, "Join Filter: " , v->join_filter, level, exind);
print_prop_if_exists(s, "Index Cond: " , v->index_cond, level, exind);
print_prop_if_exists(s, "Recheck Cond: ", v->recheck_cond, level, exind);
- print_propstr_if_exists(s, "Sort Key: ", v->sort_key, level, exind);
+ if (HASSTRING(v->sampling_method))
+ {
+ appendStringInfoString(s, "\n");
+ appendStringInfoSpaces(s, TEXT_INDENT_DETAILS(level, exind));
+ appendStringInfo(s, "Sampling: %s (%s)",
+ v->sampling_method,
+ v->sampling_params ? v->sampling_params->data : "");
+ if (v->repeatable_seed)
+ appendStringInfo(s, " REPEATABLE (%s)", v->repeatable_seed);
+ }
+
+ print_propstr_if_exists(s, "Sort Key: ", v->sort_key, level, exind);
if (HASSTRING(v->sort_method))
{
appendStringInfoString(s, "\n");
StringInfo conflict_arbiter_indexes;
const char *tuples_inserted;
const char *conflicting_tuples;
+ const char *sampling_method;
+ StringInfo sampling_params;
+ const char *repeatable_seed;
const char *tmp_obj_name;
const char *tmp_schema_name;
SETTERDECL(conflict_arbiter_indexes);
SETTERDECL(tuples_inserted);
SETTERDECL(conflicting_tuples);
+SETTERDECL(sampling_method);
+SETTERDECL(sampling_params);
+SETTERDECL(repeatable_seed);