pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't copy extended statistics during MERGE/SPLIT partition oper
Date: Wed, 22 May 2024 23:35:03 +0000
Message-ID: <E1s9vU7-001OLk-9G@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1s9vU7-001OLk-9G@gemulon.postgresql.org>
Permalink:  ../E1s9vU7-001OLk-9G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1s9vU7-001OLk-9G@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Don't copy extended statistics during MERGE/SPLIT partition oper
  In-Reply-To: <E1s9vU7-001OLk-9G@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox