Re: Preserve index stats during ALTER TABLE ... TYPE ...
| От | Michael Paquier |
|---|---|
| Тема | Re: Preserve index stats during ALTER TABLE ... TYPE ... |
| Дата | |
| Msg-id | aPB9Odd4Kwz78F2q@paquier.xyz обсуждение исходный текст |
| Ответ на | Re: Preserve index stats during ALTER TABLE ... TYPE ... (Sami Imseih <samimseih@gmail.com>) |
| Ответы |
Re: Preserve index stats during ALTER TABLE ... TYPE ...
Re: Preserve index stats during ALTER TABLE ... TYPE ... |
| Список | pgsql-hackers |
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). > > I agree. 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? A REINDEX (including CONCURRENTLY), while it initiates a rewrite of the index, does not change the definition of the underlying index. A type alteration, on the contrary, does. Hence, the planner may decide to treat a given index differently (doesn't it? Tuple width or whole-row references come into mind). Keeping the past stats may actually lead to confusing conclusions when overlapping them with some of the new number generated under the new type? Could there be more benefits in always resetting them as we do now? Any thoughts from others? -- Michael
Вложения
В списке pgsql-hackers по дате отправления: