diff options
Diffstat (limited to 'src/backend/commands/analyze.c')
-rw-r--r-- | src/backend/commands/analyze.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index d447bc9b436..a0da998c2ea 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -549,7 +549,6 @@ do_analyze_rel(Relation onerel, VacuumParams *params, { MemoryContext col_context, old_context; - bool build_ext_stats; pgstat_progress_update_param(PROGRESS_ANALYZE_PHASE, PROGRESS_ANALYZE_PHASE_COMPUTE_STATS); @@ -613,30 +612,9 @@ do_analyze_rel(Relation onerel, VacuumParams *params, thisdata->attr_cnt, thisdata->vacattrstats); } - /* - * Should we build extended statistics for this relation? - * - * The extended statistics catalog does not include an inheritance - * flag, so we can't store statistics built both with and without - * data from child relations. We can store just one set of statistics - * per relation. For plain relations that's fine, but for inheritance - * trees we have to pick whether to store statistics for just the - * one relation or the whole tree. For plain inheritance we store - * the (!inh) version, mostly for backwards compatibility reasons. - * For partitioned tables that's pointless (the non-leaf tables are - * always empty), so we store stats representing the whole tree. - */ - build_ext_stats = (onerel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) ? inh : (!inh); - - /* - * Build extended statistics (if there are any). - * - * For now we only build extended statistics on individual relations, - * not for relations representing inheritance trees. - */ - if (build_ext_stats) - BuildRelationExtStatistics(onerel, totalrows, numrows, rows, - attr_cnt, vacattrstats); + /* Build extended statistics (if there are any). */ + BuildRelationExtStatistics(onerel, inh, totalrows, numrows, rows, + attr_cnt, vacattrstats); } pgstat_progress_update_param(PROGRESS_ANALYZE_PHASE, |