Re: Improve docs for n_distinct_inherited
David G. Johnston <david.g.johnston@gmail.com>
From: "David G. Johnston" <david.g.johnston@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2025-05-08T14:49:32Z
Lists: pgsql-hackers
On Wed, May 7, 2025 at 11:41 PM David Rowley <dgrowleyml@gmail.com> wrote:
> On Thu, 8 May 2025 at 15:23, David G. Johnston
> <david.g.johnston@gmail.com> wrote:
> > Not liking the proposal, not sure it is even correct. Somehow "children
> of inheritance parent tables" are omitted.
>
> I don't see the quoted text anywhere in this area, so I'm not sure I
> follow what you mean with the omission.
>
Omitted from your v1 patch.
The two options for sample
> sets are 1) stainherits==true and 2) stainherits==false. With
> inheritance parent tables, ANALYZE gathers both sets and records both
> sets in pg_statistic.
I was missing this key piece of knowledge which invalidated my entire
attempt.
Here's an attempt at shortening this now that I understand the mechanics
better.
Separate options exist because an inheritance parent table has two
different sets of statistics: one considering only itself and one
which
also includes its children (<literal>n_distinct_inherited</literal>).
Partitioned tables, which only have rows in the children, likewise
uses
the inherited option while everyone else uses
<literal>n_distinct</literal>.
David J.
Commits
-
Doc: clarify n_distinct_inherited setting
- c3b9e565137b 13.23 landed
- 715eb62e30ac 14.20 landed
- 46086fb6812f 15.15 landed
- 0a47f054ef8d 16.11 landed
- f428b1231ccf 17.7 landed
- f691e72585a3 18.1 landed
- 615a0fc2f1fd 19 (unreleased) landed