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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Preserve index stats during ALTER TABLE ... TYPE ...
Date: 2025-10-20 06:53:37
Message-ID: aPXccXZEJrPKA8mG@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Filip Janus 2025-10-20 07:12:52 Channel binding for post-quantum cryptography
Previous Message Michael Paquier 2025-10-20 06:45:14 Re: Import Statistics in postgres_fdw before resorting to sampling.