Re: Preserve index stats during ALTER TABLE ... TYPE ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Preserve index stats during ALTER TABLE ... TYPE ...
Дата
Msg-id 1375179.1760593099@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Preserve index stats during ALTER TABLE ... TYPE ...  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Preserve index stats during ALTER TABLE ... TYPE ...
Список pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Fri, Oct 10, 2025 at 07:37:59AM -0500, Sami Imseih wrote:
> As you can see, the index stats (linked to the column that has been altered) are
> not preserved. I think that they should be preserved (like a REINDEX does).

> Hmm.  Why should it be always OK to preserve the stats of an index
> when one of its attributes is changed so as a relation is rewritten?

Right offhand, this proposal seems utterly unsafe, to the point of
maybe introducing security-grade bugs.  I see that the patch compares
opfamilies but that seems insufficient, since "same opfamily" does not
mean "binary compatible".  We could easily be restoring stats whose
binary content is incompatible with the new column type.

            regards, tom lane



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