pgsql: Don't copy extended statistics during MERGE/SPLIT partition oper

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't copy extended statistics during MERGE/SPLIT partition oper
Date: 2024-05-22 23:35:03
Message-ID: E1s9vU7-001OLk-9G@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't copy extended statistics during MERGE/SPLIT partition operations

When MERGE/SPLIT created new partitions, it was cloning the extended
statistics of the parent table.

However, extended stats on partitioned tables don't behave like
indexes on partitioned tables (which exist only to create physical
indexes on child tables). Rather, extended stats on a parent 1) cause
extended stats to be collected and computed across the whole partition
hierarchy, and 2) do not cause extended stats to be computed for the
individual partitions.

"CREATE TABLE ... PARTITION OF" command doesn't copy extended
statistics. This commit makes createPartitionTable() behave
consistently.

Reported-by: Justin Pryzby
Discussion: https://postgr.es/m/ZiJW1g2nbQs9ekwK%40pryzbyj2023
Author: Alexander Korotkov, Justin Pryzby

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fbd4321fd5b4400fbbf356d686af6ad6d3208c66

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml | 9 +++++++--
src/backend/commands/tablecmds.c | 8 +++++---
2 files changed, 12 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2024-05-23 03:25:12 pgsql: Fix a couple of outdated comments now that we have MERGE RETURNI
Previous Message Alexander Korotkov 2024-05-22 23:19:55 pgsql: amcheck: Report an error when the next page to a leaf is not a l