Re: Add index scan progress to pg_stat_progress_vacuum

From: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, "Nathan Bossart" <nathandbossart(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add index scan progress to pg_stat_progress_vacuum
Date: 2023-02-18 02:46:27
Message-ID: 7FA3FFFF-107B-443B-B85F-78C7988BE3F6@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for the review!

> + <row>
> + <entry><literal>ParallelVacuumFinish</literal></entry>
> + <entry>Waiting for parallel vacuum workers to finish index
> vacuum.</entry>
> + </row>

> This change is out-of-date.

That was an oversight. Thanks for catching.

> Total number of indexes that will be vacuumed or cleaned up. This
> number is reported as of the beginning of the vacuuming indexes phase
> or the cleaning up indexes phase.

This is cleaner. I was being unnecessarily verbose in the original description.

> Number of indexes processed. This counter only advances when the phase
> is vacuuming indexes or cleaning up indexes.

I agree.

> Also, index_processed sounds accurate to me. What do you think?

At one point, II used index_processed, but decided to change it.
"processed" makes sense also. I will use this.

> I think these settings are not necessary since the pcxt is palloc0'ed.

Good point.

> Assert(pvs->pcxt->parallel_progress_callback_arg) looks wrong to me.
> If 'arg' is NULL, a SEGV happens.

Correct, Assert(pvs) is all that is needed.

> I think it's better to update pvs->shared->nindexes_completed by both
> leader and worker processes who processed the index.

No reason for that, since only the leader process can report process to
backend_progress.

> I think it's better to make the function type consistent with the
> existing parallel_worker_main_type. How about
> parallel_progress_callback_type?

Yes, that makes sense.

> I've attached a patch that incorporates the above comments and has
> some suggestions of updating comments etc.

I reviewed and incorporated these changes, with a slight change. See v24.

- * Increase and report the number of index. Also, we reset the progress
- * counters.

+ * Increase and report the number of index scans. Also, we reset the progress
+ * counters.

Thanks

--
Sami Imseih
Amazon Web Services (AWS)

Attachment Content-Type Size
v24-0001-Add-2-new-columns-to-pg_stat_progress_vacuum.-Th.patch application/octet-stream 14.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-02-18 03:37:59 Re: Change xl_hash_vacuum_one_page.ntuples from int to uint16
Previous Message Andres Freund 2023-02-18 01:06:49 Re: windows CI failing PMSignalState->PMChildFlags[slot] == PM_CHILD_ASSIGNED