Fwd: [PATCH] Support for basic ALTER TABLE progress reporting. - Mailing list pgsql-hackers

From Jiří Kavalík
Subject Fwd: [PATCH] Support for basic ALTER TABLE progress reporting.
Date
Msg-id CAKMhz2nNOSpqT4ixmPP8-MLhd9AErWpEFaqJf9TC3Zw2=nKNWQ@mail.gmail.com
Whole thread Raw
In response to [PATCH] Support for basic ALTER TABLE progress reporting.  (Jiří Kavalík <jkavalik@gmail.com>)
Responses Re: Fwd: [PATCH] Support for basic ALTER TABLE progress reporting.
List pgsql-hackers
I did not add CC to the list to my reply so forwarding..

---------- Forwarded message ---------
From: Jiří Kavalík <jkavalik@gmail.com>
Date: Sun, Jul 20, 2025 at 8:22 PM
Subject: Re: [PATCH] Support for basic ALTER TABLE progress reporting.
To: jian he <jian.universality@gmail.com>


Hello,

On Tue, Jul 8, 2025 at 3:42 PM jian he <jian.universality@gmail.com> wrote:
hi.
within ATRewriteTable we have:
pgstat_progress_update_param(PROGRESS_CLUSTER_TOTAL_HEAP_BLKS,
RelationGetNumberOfBlocks(oldrel));
        pgstat_progress_update_param(PROGRESS_CLUSTER_TOTAL_HEAP_BLKS,
                                             heapScan->rs_nblocks);

PROGRESS_CLUSTER_TOTAL_HEAP_BLKS
value is fixed, we only need to call pgstat_progress_update_param once here?
Yes, that was redundant, removed. 

another patch [1] is expected to refactor pg_stat_progress_cluster a lot, so I'm
unsure whether it's a good idea to put CLUSTER, VACUUM FULL, or ALTER TABLE into
pg_stat_progress_cluster.
alternatively, we could introduce a separate progress report specifically for
ALTER TABLE, allowing us to distinguish between table rewrite and table
scan.
[1] https://commitfest.postgresql.org/patch/5117

I noticed that but not sure if it is targeting v19? I hoped to make the change as small as possible, but if it would collide with the refactoring then it makes sense to separate the functionality.
I am attaching the updated patch for the current "minimal" version for now. But I will look into making it a standalone feature.

Thank you for your insights.

Best regards
jkavalik 
Attachment

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: IPC/MultixactCreation on the Standby server
Next
From: Álvaro Herrera
Date:
Subject: Re: Fwd: [PATCH] Support for basic ALTER TABLE progress reporting.