Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2024-05-14 14:49:53
Message-ID: ZkN6EfjQGz8TOhbL@pryzbyj2023
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 09, 2024 at 12:51:32AM +0300, Alexander Korotkov wrote:
> > > However, parent's table extended statistics already covers all its
> > > children.
> >
> > => That's the wrong explanation. It's not that "stats on the parent
> > table cover its children". It's that there are two types of stats:
> > stats for the "table hierarchy" and stats for the individual table.
> > That's true for single-column stats as well as for extended stats.
> > In both cases, that's indicated by the inh flag in the code and in the
> > catalog.
> >
> > The right explanation is that extended stats on partitioned tables are
> > not similar to indexes. Indexes on parent table are nothing other than
> > a mechanism to create indexes on the child tables. That's not true for
> > stats.
> >
> > See also my prior messages
> > ZiJW1g2nbQs9ekwK(at)pryzbyj2023
> > Zi5Msg74C61DjJKW(at)pryzbyj2023
>
> Yes, I understand that parents pg_statistic entry with stainherit ==
> true includes statistics for the children. I tried to express this by
> word "covers". But you're right, this is the wrong explanation.
>
> Can I, please, ask you to revise the patch?

I tried to make this clear but it'd be nice if someone (Tomas/Alvaro?)
would check that this says what's wanted.

--
Justin

Attachment Content-Type Size
0001-Don-t-copy-extended-statistics-during-MERGE-SPLIT-pa.patch text/x-diff 4.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-05-14 14:54:29 Re: I have an exporting need...
Previous Message Alvaro Herrera 2024-05-14 14:42:04 Re: Dump-restore loosing 'attnotnull' bit for DEFERRABLE PRIMARY KEY column(s).