42 #include "utils/fmgroids.h" 59 #define WIDTH_THRESHOLD 1024 129 "BuildRelationExtStatistics",
137 if (statslist !=
NIL)
139 const int index[] = {
143 const int64
val[] = {
152 foreach(lc, statslist)
169 natts, vacattrstats);
174 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
175 errmsg(
"statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"",
197 data =
make_build_data(onerel, stat, numrows, rows, stats, stattarget);
200 foreach(lc2, stat->
types)
204 if (t == STATS_EXT_NDISTINCT)
206 else if (t == STATS_EXT_DEPENDENCIES)
208 else if (t == STATS_EXT_MCV)
210 else if (t == STATS_EXT_EXPRESSIONS)
217 elog(
ERROR,
"requested expression stats, but there are no expressions");
276 "ComputeExtStatisticsRows",
296 natts, vacattrstats);
309 if (stattarget > result)
319 return (300 * result);
359 for (i = 0; i < nattrs; i++)
362 if (stats[i]->attr->attstattarget > stattarget)
363 stattarget = stats[
i]->
attr->attstattarget;
375 Assert((stattarget >= 0) && (stattarget <= 10000));
391 case STATS_EXT_NDISTINCT:
392 attnum = Anum_pg_statistic_ext_data_stxdndistinct;
395 case STATS_EXT_DEPENDENCIES:
396 attnum = Anum_pg_statistic_ext_data_stxddependencies;
400 attnum = Anum_pg_statistic_ext_data_stxdmcv;
403 case STATS_EXT_EXPRESSIONS:
404 attnum = Anum_pg_statistic_ext_data_stxdexpr;
408 elog(
ERROR,
"unexpected statistics type requested: %d", type);
430 Anum_pg_statistic_ext_stxrelid,
454 for (i = 0; i < staForm->stxkeys.dim1; i++)
457 staForm->stxkeys.values[i]);
462 Anum_pg_statistic_ext_stxkind, &isnull);
468 elog(
ERROR,
"stxkind is not a 1-D char array");
470 for (i = 0; i <
ARR_DIMS(arr)[0]; i++)
472 Assert((enabled[i] == STATS_EXT_NDISTINCT) ||
473 (enabled[i] == STATS_EXT_DEPENDENCIES) ||
474 (enabled[i] == STATS_EXT_MCV) ||
475 (enabled[i] == STATS_EXT_EXPRESSIONS));
481 Anum_pg_statistic_ext_stxexprs, &isnull);
508 result =
lappend(result, entry);
538 stats->
attr->attstattarget = -1;
724 for (j = 0; j < nvacatts; j++)
726 if (x == vacatts[j]->tupattnum)
728 stats[
i] = vacatts[j];
748 Assert(!stats[i]->attr->attisdropped);
788 bool nulls[Natts_pg_statistic_ext_data];
789 bool replaces[Natts_pg_statistic_ext_data];
793 memset(nulls,
true,
sizeof(nulls));
794 memset(replaces,
false,
sizeof(replaces));
795 memset(values, 0,
sizeof(values));
801 if (ndistinct != NULL)
805 nulls[Anum_pg_statistic_ext_data_stxdndistinct - 1] = (data == NULL);
806 values[Anum_pg_statistic_ext_data_stxdndistinct - 1] =
PointerGetDatum(data);
809 if (dependencies != NULL)
813 nulls[Anum_pg_statistic_ext_data_stxddependencies - 1] = (data == NULL);
814 values[Anum_pg_statistic_ext_data_stxddependencies - 1] =
PointerGetDatum(data);
820 nulls[Anum_pg_statistic_ext_data_stxdmcv - 1] = (data == NULL);
821 values[Anum_pg_statistic_ext_data_stxdmcv - 1] =
PointerGetDatum(data);
823 if (exprs != (
Datum) 0)
825 nulls[Anum_pg_statistic_ext_data_stxdexpr - 1] =
false;
826 values[Anum_pg_statistic_ext_data_stxdexpr - 1] =
exprs;
830 replaces[Anum_pg_statistic_ext_data_stxdndistinct - 1] =
true;
831 replaces[Anum_pg_statistic_ext_data_stxddependencies - 1] =
true;
832 replaces[Anum_pg_statistic_ext_data_stxdmcv - 1] =
true;
833 replaces[Anum_pg_statistic_ext_data_stxdexpr - 1] =
true;
838 elog(
ERROR,
"cache lookup failed for statistics object %u", statOid);
896 for (i = 0; i < mss->
ndims; i++)
929 for (dim = start; dim <= end; dim++)
981 int attnum = (j - nexprs);
991 Assert(attnum >= (-nexprs));
1018 int nvalues = data->
numrows * numattrs;
1037 values = (
Datum *) ptr;
1038 ptr += nvalues *
sizeof(
Datum);
1040 isnull = (
bool *) ptr;
1041 ptr += nvalues *
sizeof(
bool);
1044 Assert((ptr - (
char *) items) == len);
1048 for (i = 0; i < data->
numrows; i++)
1050 items[nrows].values = &values[nrows * numattrs];
1051 items[nrows].isnull = &isnull[nrows * numattrs];
1058 for (i = 0; i < data->
nattnums; i++)
1062 for (i = 0; i < data->
numrows; i++)
1064 bool toowide =
false;
1067 for (j = 0; j < numattrs; j++)
1077 for (idx = 0; idx < data->
nattnums; idx++)
1079 if (attnum == data->
attnums[idx])
1083 Assert(idx < data->nattnums);
1087 attlen = typlen[
idx];
1098 if ((!isnull) && (attlen == -1))
1109 items[nrows].values[j] =
value;
1110 items[nrows].isnull[j] = isnull;
1150 if (stat->
kind == requiredkind)
1171 foreach(lc, stat->
exprs)
1175 if (
equal(stat_expr, expr))
1206 if (expr_idxs != NULL)
1239 int best_num_matched = 2;
1252 if (info->
kind != requiredkind)
1263 for (i = 0; i < nclauses; i++)
1268 if (!clause_attnums[i] && !clause_exprs[i])
1277 matched_attnums =
bms_add_members(matched_attnums, clause_attnums[i]);
1298 if (num_matched > best_num_matched ||
1299 (num_matched == best_num_matched && numkeys < best_match_keys))
1302 best_num_matched = num_matched;
1303 best_match_keys = numkeys;
1331 Var *var = (
Var *) clause;
1334 if (var->
varno != relid)
1403 if (
IsA(clause_expr,
Var))
1405 relid, attnums, exprs);
1408 *exprs =
lappend(*exprs, clause_expr);
1465 if (
IsA(clause_expr,
Var))
1467 relid, attnums, exprs);
1470 *exprs =
lappend(*exprs, clause_expr);
1496 foreach(lc, expr->
args)
1504 relid, attnums, exprs))
1519 relid, attnums, exprs);
1530 *exprs =
lappend(*exprs, clause);
1576 foreach(lc, expr->
args)
1579 relid, attnums,
exprs))
1596 clause_relid != relid)
1601 relid, attnums,
exprs))
1621 clause_attnums = *attnums;
1725 list_attnums[listidx] = attnums;
1726 list_exprs[listidx] =
exprs;
1730 list_attnums[listidx] = NULL;
1731 list_exprs[listidx] =
NIL;
1746 list_attnums, list_exprs,
1763 simple_clauses = NULL;
1783 if (!list_attnums[listidx] && !list_exprs[listidx])
1804 if ((list_attnums[listidx] == NULL &&
1806 (list_exprs[listidx] ==
NIL &&
1820 list_attnums[listidx] = NULL;
1823 list_exprs[listidx] = NULL;
1828 bool *or_matches = NULL;
1847 foreach(l, stat_clauses)
1867 jointype, sjinfo,
false);
1869 overlap_simple_sel = simple_or_sel * simple_sel;
1875 simple_or_sel += simple_sel - overlap_simple_sel;
1884 clause, &or_matches,
1900 clause_sel = simple_sel;
1913 stat_sel += clause_sel - overlap_sel;
1924 sel = sel + stat_sel - sel * stat_sel;
1947 varRelid, jointype, sjinfo,
1979 sjinfo, rel, estimatedclauses, is_or);
2002 jointype, sjinfo, rel,
2045 expr = (
Node *) leftop;
2046 cst = (
Const *) rightop;
2051 expr = (
Node *) rightop;
2052 cst = (
Const *) leftop;
2066 *expronleftp = expronleft;
2086 "Analyze Expression",
2090 for (ind = 0; ind < nexprs; ind++)
2126 exprnulls = (
bool *)
palloc(numrows *
sizeof(
bool));
2129 for (i = 0; i < numrows; i++)
2153 exprvals[tcnt] = (
Datum) 0;
2154 exprnulls[tcnt] =
true;
2164 exprnulls[tcnt] =
false;
2183 stats->
attr->attnum);
2252 thisdata->
expr = expr;
2276 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
2277 errmsg(
"relation \"pg_statistic\" does not have a composite type")));
2279 for (exprno = 0; exprno < nexprs; exprno++)
2286 bool nulls[Natts_pg_statistic];
2302 for (i = 0; i < Natts_pg_statistic; ++
i)
2309 values[Anum_pg_statistic_stainherit - 1] =
BoolGetDatum(
false);
2313 i = Anum_pg_statistic_stakind1 - 1;
2318 i = Anum_pg_statistic_staop1 - 1;
2323 i = Anum_pg_statistic_stacoll1 - 1;
2328 i = Anum_pg_statistic_stanumbers1 - 1;
2339 for (n = 0; n < nnum; n++)
2344 sizeof(
float4),
true, TYPALIGN_INT);
2350 values[i++] = (
Datum) 0;
2353 i = Anum_pg_statistic_stavalues1 - 1;
2371 values[i++] = (
Datum) 0;
2406 elog(
ERROR,
"cache lookup failed for statistics object %u", stxoid);
2409 Anum_pg_statistic_ext_data_stxdexpr, &isnull);
2412 "requested statistics kind \"%c\" is not yet built for statistics object %u",
2413 STATS_EXT_DEPENDENCIES, stxoid);
2468 len +=
MAXALIGN(
sizeof(
bool *) * nkeys);
2469 len += nkeys *
MAXALIGN(
sizeof(
bool) * numrows);
2490 result->
nulls = (
bool **) ptr;
2491 ptr +=
MAXALIGN(
sizeof(
bool *) * nkeys);
2493 for (i = 0; i < nkeys; i++)
2498 result->
nulls[
i] = (
bool *) ptr;
2499 ptr +=
MAXALIGN(
sizeof(
bool) * numrows);
2502 Assert((ptr - (
char *) result) == len);
2505 result->nattnums = nkeys;
2506 result->numrows = numrows;
2513 result->attnums[
idx] = k;
2514 result->stats[
idx] = stats[
idx];
2520 foreach(lc, stat->
exprs)
2524 result->attnums[
idx] = k;
2532 for (i = 0; i < numrows; i++)
2539 result->stats[idx]->tupDesc,
2540 &result->nulls[idx][i]);
2560 for (i = 0; i < numrows; i++)
2572 foreach(lc, exprstates)
2589 result->nulls[
idx][
i] =
true;
2594 result->nulls[
idx][
i] =
false;
static Datum Float4GetDatum(float4 X)
AttributeOpts * get_attribute_options(Oid attrelid, int attnum)
static VacAttrStats * examine_expression(Node *expr, int stattarget)
static VacAttrStats * examine_attribute(Node *expr)
HeapTuple heap_copytuple(HeapTuple tuple)
Selectivity dependencies_clauselist_selectivity(PlannerInfo *root, List *clauses, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo, RelOptInfo *rel, Bitmapset **estimatedclauses)
int ComputeExtStatisticsRows(Relation onerel, int natts, VacAttrStats **vacattrstats)
bool get_func_leakproof(Oid funcid)
#define IsA(nodeptr, _type_)
#define PROGRESS_ANALYZE_EXT_STATS_COMPUTED
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
void table_close(Relation relation, LOCKMODE lockmode)
void systable_endscan(SysScanDesc sysscan)
static int stat_find_expression(StatisticExtInfo *stat, Node *expr)
void deconstruct_expanded_array(ExpandedArrayHeader *eah)
#define PROGRESS_ANALYZE_PHASE
AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mode)
bool equal(const void *a, const void *b)
#define RelationGetDescr(relation)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
HeapTuple statext_expressions_load(Oid stxoid, int idx)
static bool is_orclause(const void *clause)
int32 exprTypmod(const Node *expr)
#define PointerGetDatum(X)
void fix_opfuncids(Node *node)
char * pstrdup(const char *in)
static bool statext_is_compatible_clause_internal(PlannerInfo *root, Node *clause, Index relid, Bitmapset **attnums, List **exprs)
int bms_next_member(const Bitmapset *a, int prevbit)
void PrepareSortSupportFromOrderingOp(Oid orderingOp, SortSupport ssup)
static int statext_compute_stattarget(int stattarget, int natts, VacAttrStats **stats)
Datum * stavalues[STATISTIC_NUM_SLOTS]
AttrNumber * build_attnums_array(Bitmapset *attrs, int nexprs, int *numattrs)
static bool is_andclause(const void *clause)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
ArrayType * construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
#define AttrNumberIsForUserDefinedAttr(attributeNumber)
int multi_sort_compare_dims(int start, int end, const SortItem *a, const SortItem *b, MultiSortSupport mss)
int errcode(int sqlerrcode)
void * stringToNode(const char *str)
bool bms_get_singleton_member(const Bitmapset *a, int *member)
Node * eval_const_expressions(PlannerInfo *root, Node *node)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
Datum idx(PG_FUNCTION_ARGS)
bool std_typanalyze(VacAttrStats *stats)
bool statext_is_kind_built(HeapTuple htup, char type)
bool statypbyval[STATISTIC_NUM_SLOTS]
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
static List * fetch_statentries_for_relation(Relation pg_statext, Oid relid)
void heap_freetuple(HeapTuple htup)
Selectivity statext_clauselist_selectivity(PlannerInfo *root, List *clauses, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo, RelOptInfo *rel, Bitmapset **estimatedclauses, bool is_or)
#define OidIsValid(objectId)
ExprState * ExecPrepareExpr(Expr *node, EState *estate)
#define DatumGetHeapTupleHeader(X)
char statypalign[STATISTIC_NUM_SLOTS]
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos)
void pgstat_progress_update_multi_param(int nparam, const int *index, const int64 *val)
#define CLAMP_PROBABILITY(p)
void FreeExecutorState(EState *estate)
#define GetPerTupleExprContext(estate)
HeapTuple systable_getnext(SysScanDesc sysscan)
void pfree(void *pointer)
MVDependencies * statext_dependencies_build(StatsBuildData *data)
static int compare(const void *arg1, const void *arg2)
SortSupportData ssup[FLEXIBLE_ARRAY_MEMBER]
#define ObjectIdGetDatum(X)
ExpandedArrayHeader * DatumGetExpandedArray(Datum d)
void multi_sort_add_dimension(MultiSortSupport mss, int sortdim, Oid oper, Oid collation)
Oid stacoll[STATISTIC_NUM_SLOTS]
#define PROGRESS_ANALYZE_EXT_STATS_TOTAL
SortItem * build_sorted_items(StatsBuildData *data, int *nitems, MultiSortSupport mss, int numattrs, AttrNumber *attnums)
void BuildRelationExtStatistics(Relation onerel, double totalrows, int numrows, HeapTuple *rows, int natts, VacAttrStats **vacattrstats)
bytea * statext_mcv_serialize(MCVList *mcvlist, VacAttrStats **stats)
#define OidFunctionCall1(functionId, arg1)
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
#define ALLOCSET_DEFAULT_SIZES
static bool stat_covers_expressions(StatisticExtInfo *stat, List *exprs, Bitmapset **expr_idxs)
int bms_num_members(const Bitmapset *a)
char * get_namespace_name(Oid nspid)
int multi_sort_compare_dim(int dim, const SortItem *a, const SortItem *b, MultiSortSupport mss)
static Selectivity statext_mcv_clauselist_selectivity(PlannerInfo *root, List *clauses, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo, RelOptInfo *rel, Bitmapset **estimatedclauses, bool is_or)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
int numnumbers[STATISTIC_NUM_SLOTS]
Selectivity mcv_combine_selectivities(Selectivity simple_sel, Selectivity mcv_sel, Selectivity mcv_basesel, Selectivity mcv_totalsel)
#define RelationGetRelationName(relation)
FormData_pg_attribute * Form_pg_attribute
int compare_scalars_simple(const void *a, const void *b, void *arg)
MemoryContext CurrentMemoryContext
MCVList * statext_mcv_load(Oid mvoid)
Size toast_raw_datum_size(Datum value)
#define ATTRIBUTE_FIXED_PART_SIZE
bool IsAutoVacuumWorkerProcess(void)
Datum makeArrayResult(ArrayBuildState *astate, MemoryContext rcontext)
static void statext_store(Oid statOid, MVNDistinct *ndistinct, MVDependencies *dependencies, MCVList *mcv, Datum exprs, VacAttrStats **stats)
Datum datumCopy(Datum value, bool typByVal, int typLen)
MultiSortSupport multi_sort_init(int ndims)
Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
EState * CreateExecutorState(void)
List * lappend_int(List *list, int datum)
List * ExecPrepareExprList(List *nodes, EState *estate)
List * lappend(List *list, void *datum)
RangeTblEntry ** simple_rte_array
static StatsBuildData * make_build_data(Relation onerel, StatExtEntry *stat, int numrows, HeapTuple *rows, VacAttrStats **stats, int stattarget)
void qsort_arg(void *base, size_t nel, size_t elsize, qsort_arg_comparator cmp, void *arg)
#define heap_getattr(tup, attnum, tupleDesc, isnull)
static bool statext_is_compatible_clause(PlannerInfo *root, Node *clause, Index relid, Bitmapset **attnums, List **exprs)
struct SortSupportData SortSupportData
Oid staop[STATISTIC_NUM_SLOTS]
HeapTuple SearchSysCache1(int cacheId, Datum key1)
static bool is_notclause(const void *clause)
int compare_datums_simple(Datum a, Datum b, SortSupport ssup)
#define AttributeNumberIsValid(attributeNumber)
#define MemoryContextResetAndDeleteChildren(ctx)
RegProcedure get_oprrest(Oid opno)
#define TextDatumGetCString(d)
BMS_Membership bms_membership(const Bitmapset *a)
void * palloc0(Size size)
void ReleaseSysCache(HeapTuple tuple)
int16 stakind[STATISTIC_NUM_SLOTS]
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
bytea * statext_ndistinct_serialize(MVNDistinct *ndistinct)
MVNDistinct * statext_ndistinct_build(double totalrows, StatsBuildData *data)
Oid get_rel_type_id(Oid relid)
struct StatExtEntry StatExtEntry
Oid statypid[STATISTIC_NUM_SLOTS]
static Datum expr_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull)
RegProcedure get_opcode(Oid opno)
#define STATISTIC_NUM_SLOTS
#define ereport(elevel,...)
#define PROGRESS_ANALYZE_PHASE_COMPUTE_EXT_STATS
void bms_free(Bitmapset *a)
Selectivity clause_selectivity_ext(PlannerInfo *root, Node *clause, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo, bool use_extended_stats)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
static AnlExprData * build_expr_data(List *exprs, int stattarget)
void pgstat_progress_update_param(int index, int64 val)
float4 * stanumbers[STATISTIC_NUM_SLOTS]
MCVList * statext_mcv_build(StatsBuildData *data, double totalrows, int stattarget)
int multi_sort_compare(const void *a, const void *b, void *arg)
StatisticExtInfo * choose_best_statistics(List *stats, char requiredkind, Bitmapset **clause_attnums, List **clause_exprs, int nclauses)
AclResult pg_attribute_aclcheck_all(Oid table_oid, Oid roleid, AclMode mode, AclMaskHow how)
void CatalogTupleUpdate(Relation heapRel, ItemPointer otid, HeapTuple tup)
Oid exprType(const Node *expr)
FormData_pg_type * Form_pg_type
static int list_length(const List *l)
Oid exprCollation(const Node *expr)
TupleTableSlot * ecxt_scantuple
VacAttrStats * vacattrstat
Bitmapset * bms_add_member(Bitmapset *a, int x)
Selectivity clauselist_selectivity_ext(PlannerInfo *root, List *clauses, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo, bool use_extended_stats)
MemoryContext anl_context
#define InvalidAttrNumber
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
static Datum values[MAXATTR]
ArrayBuildState * accumArrayResult(ArrayBuildState *astate, Datum dvalue, bool disnull, Oid element_type, MemoryContext rcontext)
#define SearchSysCacheCopy1(cacheId, key1)
#define ItemPointerSetInvalid(pointer)
int numvalues[STATISTIC_NUM_SLOTS]
int16 get_typlen(Oid typid)
#define STATS_MAX_DIMENSIONS
int errmsg(const char *fmt,...)
bytea * statext_dependencies_serialize(MVDependencies *dependencies)
int16 statyplen[STATISTIC_NUM_SLOTS]
void list_free(List *list)
const TupleTableSlotOps TTSOpsHeapTuple
AnalyzeAttrComputeStatsFunc compute_stats
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Selectivity mcv_clauselist_selectivity(PlannerInfo *root, StatisticExtInfo *stat, List *clauses, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo, RelOptInfo *rel, Selectivity *basesel, Selectivity *totalsel)
struct AnlExprData AnlExprData
#define PG_DETOAST_DATUM(datum)
MultiSortSupportData * MultiSortSupport
static bool is_opclause(const void *clause)
Operator oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId, bool noError, int location)
#define StatisticExtRelidIndexId
static void compute_expr_stats(Relation onerel, double totalrows, AnlExprData *exprdata, int nexprs, HeapTuple *rows, int numrows)
Relation table_open(Oid relationId, LOCKMODE lockmode)
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *replValues, bool *replIsnull, bool *doReplace)
static int ApplySortComparator(Datum datum1, bool isNull1, Datum datum2, bool isNull2, SortSupport ssup)
int errtable(Relation rel)
bool bms_is_member(int x, const Bitmapset *a)
bool has_stats_of_kind(List *stats, char requiredkind)
#define RelationGetRelid(relation)
TupleTableSlot * ExecStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
#define BTEqualStrategyNumber
#define offsetof(type, field)
Bitmapset * bms_add_members(Bitmapset *a, const Bitmapset *b)
int default_statistics_target
FormData_pg_statistic_ext * Form_pg_statistic_ext
#define ResetExprContext(econtext)
bool examine_opclause_args(List *args, Node **exprp, Const **cstp, bool *expronleftp)
static VacAttrStats ** lookup_var_attr_stats(Relation rel, Bitmapset *attrs, List *exprs, int nvacatts, VacAttrStats **vacatts)
static Datum serialize_expr_stats(AnlExprData *exprdata, int nexprs)
#define HeapTupleHeaderGetDatumLength(tup)
Selectivity mcv_clause_selectivity_or(PlannerInfo *root, StatisticExtInfo *stat, MCVList *mcv, Node *clause, bool **or_matches, Selectivity *basesel, Selectivity *overlap_mcvsel, Selectivity *overlap_basesel, Selectivity *totalsel)
#define DatumGetArrayTypeP(X)