Here's v6 of this patch. I have rebased on top of today's CLUSTER monitoring, as well as on table AM commits. The latter caused a bit of trouble, as now the number of blocks processed by a scan is not as easy to get as before; I added a new entry point heapscan_get_blocks_done on heapam.c to help with that. (I suppose this will need some fixups later on.)
I removed the "M of N" phase labels that Robert didn't like; those were suggested by Rahila and upvoted by Amit L. I'm of two minds about those. If you care about those and want them back, please speak up.
I see value in reporting those numbers because it gives user insight into where
we are at in the whole process without having to refer to documentation or code.
Besides here also we are reporting facts as we follow for other metrics.
I agree that it will be most effective if the phases are carried out in succession
which is not the case every time and its relevance varies for each command as mentioned upthread by Alvaro and Robert. But I feel as long as we have in the documentation that some phases overlap, some are mutually exclusive hence may be skipped etc. reporting `phase number versus total phases` does provide valuable information.
We are able to give user a whole picture in addition to reporting progress within phases.