Re: Preserve index stats during ALTER TABLE ... TYPE ... - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Preserve index stats during ALTER TABLE ... TYPE ...
Date
Msg-id aPXccXZEJrPKA8mG@paquier.xyz
Whole thread Raw
In response to Re: Preserve index stats during ALTER TABLE ... TYPE ...  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
List pgsql-hackers
On Mon, Oct 20, 2025 at 06:22:00AM +0000, Bertrand Drouvot wrote:
> On Mon, Oct 20, 2025 at 10:53:37AM +0900, Michael Paquier wrote:
>> It may be time to do a clean split, even if the current state of
>> business in pgstat.h is a kind of historical thing.
>
> Yeah, but maybe it would make more sense to look at this once the relfilenode
> stats one ([2]) is done? (see [3]).

Ah, right, that rings a bell now.  So as you mention the history of
events is that the refactoring related to relfilenodes should happen
first.  Maybe we should just focus on that for now, then.  TBH, I
cannot get excited for the moment in making tablecmds.c more complex
regarding its stats handling on rewrite without knowing if it could
become actually simpler.  This is also assuming that we actually do
something about it, at the end, which is not something I am sure is
worth the extra complications in ALTER TABLE.  And perhaps we could
get some nice side effects of the other discussion for what you are
proposing (first answer points to no, but it's hard to say as well if
that would be a definitive answer).
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Import Statistics in postgres_fdw before resorting to sampling.
Next
From: Filip Janus
Date:
Subject: Channel binding for post-quantum cryptography