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>
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.
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.