diff options
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r-- | src/backend/postmaster/pgstat.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index a3c35bdf609..4a280897b19 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -1632,8 +1632,11 @@ pgstat_report_analyze(Relation rel, * be double-counted after commit. (This approach also ensures that the * collector ends up with the right numbers if we abort instead of * committing.) + * + * Waste no time on partitioned tables, though. */ - if (rel->pgstat_info != NULL) + if (rel->pgstat_info != NULL && + rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE) { PgStat_TableXactStatus *trans; @@ -1997,8 +2000,10 @@ pgstat_initstats(Relation rel) Oid rel_id = rel->rd_id; char relkind = rel->rd_rel->relkind; - /* We only count stats for things that have storage */ - if (!RELKIND_HAS_STORAGE(relkind)) + /* + * We only count stats for relations with storage and partitioned tables + */ + if (!RELKIND_HAS_STORAGE(relkind) && relkind != RELKIND_PARTITIONED_TABLE) { rel->pgstat_info = NULL; return; |