diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_statistic_ext_data.h | 4 | ||||
-rw-r--r-- | src/include/commands/defrem.h | 1 | ||||
-rw-r--r-- | src/include/nodes/pathnodes.h | 1 | ||||
-rw-r--r-- | src/include/statistics/statistics.h | 11 |
5 files changed, 12 insertions, 7 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index fc904bcb9be..8324d957633 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202201121 +#define CATALOG_VERSION_NO 202201161 #endif diff --git a/src/include/catalog/pg_statistic_ext_data.h b/src/include/catalog/pg_statistic_ext_data.h index 7c94d7b7cd7..b01e6205974 100644 --- a/src/include/catalog/pg_statistic_ext_data.h +++ b/src/include/catalog/pg_statistic_ext_data.h @@ -32,6 +32,7 @@ CATALOG(pg_statistic_ext_data,3429,StatisticExtDataRelationId) { Oid stxoid BKI_LOOKUP(pg_statistic_ext); /* statistics object * this data is for */ + bool stxdinherit; /* true if inheritance children are included */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ @@ -53,6 +54,7 @@ typedef FormData_pg_statistic_ext_data * Form_pg_statistic_ext_data; DECLARE_TOAST(pg_statistic_ext_data, 3430, 3431); -DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_data_stxoid_index, 3433, StatisticExtDataStxoidIndexId, on pg_statistic_ext_data using btree(stxoid oid_ops)); +DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_data_stxoid_inh_index, 3433, StatisticExtDataStxoidInhIndexId, on pg_statistic_ext_data using btree(stxoid oid_ops, stxdinherit bool_ops)); + #endif /* PG_STATISTIC_EXT_DATA_H */ diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 2d3cdddaf48..56d2bb66161 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -83,6 +83,7 @@ extern ObjectAddress AlterOperator(AlterOperatorStmt *stmt); extern ObjectAddress CreateStatistics(CreateStatsStmt *stmt); extern ObjectAddress AlterStatistics(AlterStatsStmt *stmt); extern void RemoveStatisticsById(Oid statsOid); +extern void RemoveStatisticsDataById(Oid statsOid, bool inh); extern Oid StatisticsGetRelation(Oid statId, bool missing_ok); /* commands/aggregatecmds.c */ diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index 1f33fe13c11..1f3845b3fec 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -934,6 +934,7 @@ typedef struct StatisticExtInfo NodeTag type; Oid statOid; /* OID of the statistics row */ + bool inherit; /* includes child relations */ RelOptInfo *rel; /* back-link to statistic's table */ char kind; /* statistics kind of this entry */ Bitmapset *keys; /* attnums of the columns covered */ diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h index 4a3676278de..bb7ef1240e0 100644 --- a/src/include/statistics/statistics.h +++ b/src/include/statistics/statistics.h @@ -94,11 +94,11 @@ typedef struct MCVList MCVItem items[FLEXIBLE_ARRAY_MEMBER]; /* array of MCV items */ } MCVList; -extern MVNDistinct *statext_ndistinct_load(Oid mvoid); -extern MVDependencies *statext_dependencies_load(Oid mvoid); -extern MCVList *statext_mcv_load(Oid mvoid); +extern MVNDistinct *statext_ndistinct_load(Oid mvoid, bool inh); +extern MVDependencies *statext_dependencies_load(Oid mvoid, bool inh); +extern MCVList *statext_mcv_load(Oid mvoid, bool inh); -extern void BuildRelationExtStatistics(Relation onerel, double totalrows, +extern void BuildRelationExtStatistics(Relation onerel, bool inh, double totalrows, int numrows, HeapTuple *rows, int natts, VacAttrStats **vacattrstats); extern int ComputeExtStatisticsRows(Relation onerel, @@ -121,9 +121,10 @@ extern Selectivity statext_clauselist_selectivity(PlannerInfo *root, bool is_or); extern bool has_stats_of_kind(List *stats, char requiredkind); extern StatisticExtInfo *choose_best_statistics(List *stats, char requiredkind, + bool inh, Bitmapset **clause_attnums, List **clause_exprs, int nclauses); -extern HeapTuple statext_expressions_load(Oid stxoid, int idx); +extern HeapTuple statext_expressions_load(Oid stxoid, bool inh, int idx); #endif /* STATISTICS_H */ |