Re: BUG #18916: alter table ... set (n_distinct=) completely ignored on partition head and/or individual partitions

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #18916: alter table ... set (n_distinct=) completely ignored on partition head and/or individual partitions
Дата
Msg-id CAApHDvrGUcw6-WMv9VKiMq2dh_j6o=D9qNecTwaXLPXU=jSvgA@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18916: alter table ... set (n_distinct=) completely ignored on partition head and/or individual partitions  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Thu, 8 May 2025 at 10:40, PG Bug reporting form
<noreply@postgresql.org> wrote:
> I don't know it's missing feature or actual bug in case of native
> partitioning
> alter table partition_head alter somefield set (n_distinct=...)
> and/or alter table individual_paritition alter somefield set
> (n_distinct=...)
> simple have no effect in distinct somefield estimations, thus leading to
> very bad plans.

You'll need to use n_distinct_inherited since partitioned tables use
the inheritance statistics.

The documentation in [1] does not seem to highlight this very well.

David

[1] https://www.postgresql.org/docs/17/sql-altertable.html



В списке pgsql-bugs по дате отправления: