Re: BUG #17123: ALTER TABLE ... NO INHERIT leaves orphaned statistics behind

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17123: ALTER TABLE ... NO INHERIT leaves orphaned statistics behind
Дата
Msg-id 86586.1627309764@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #17123: ALTER TABLE ... NO INHERIT leaves orphaned statistics behind  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17123: ALTER TABLE ... NO INHERIT leaves orphaned statistics behind  (Christoph Berg <christoph.berg@credativ.de>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> Removing the last/only inheritance child from a table using ALTER TABLE NO
> INHERIT leaves orphaned statistics behind that ANALYZE doesn't remove.
> Original customer complaint on 10.16, but 15devel has the same issue.

Good catch.  I imagine DETACH PARTITION has related issues?

It seems like there are basically two ways to fix this:

1. Make ALTER TABLE NO INHERIT/DETACH PARTITION get rid of
no-longer-wanted stats.

2. Make ANALYZE check for and remove any inappropriate stats.

I'm kind of inclined to prefer #1, on the grounds that #2 would
add almost-always-useless cycles to every ANALYZE run forevermore.
On the other hand, #2 seems a bit more robust, in that we'd not
have to remember to consider this issue every time somebody invents
a new flavor of DDL that affects these things.

Thoughts?

            regards, tom lane



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17123: ALTER TABLE ... NO INHERIT leaves orphaned statistics behind
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: BUG #17123: ALTER TABLE ... NO INHERIT leaves orphaned statistics behind