Re: Add index scan progress to pg_stat_progress_vacuum
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: "Imseih (AWS), Sami" <simseih@amazon.com>
Cc: Robert Haas <robertmhaas@gmail.com>, "Bossart,
Nathan" <bossartn@amazon.com>, Andres Freund <andres@anarazel.de>, Peter Geoghegan <pg@bowt.ie>,
Justin Pryzby <pryzby@telsasoft.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-06-03T05:39:52Z
Lists: pgsql-hackers
On Fri, May 27, 2022 at 10:52 AM Imseih (AWS), Sami <simseih@amazon.com> wrote: > > > Another idea I came up with is that we can wait for all index vacuums > > to finish while checking and updating the progress information, and > > then calls WaitForParallelWorkersToFinish after confirming all index > > status became COMPLETED. That way, we don’t need to change the > > parallel query infrastructure. What do you think? > > Thinking about this a bit more, the idea of using > WaitForParallelWorkersToFinish > Will not work if you have a leader worker that is > stuck on a large index. The progress will not be updated > until the leader completes. Even if the parallel workers > finish. Right. > > What are your thought about piggybacking on the > vacuum_delay_point to update progress. The leader can > perhaps keep a counter to update progress every few thousand > calls to vacuum_delay_point. > > This goes back to your original idea to keep updating progress > while scanning the indexes. I think we can have the leader process wait for all index statuses to become COMPLETED before WaitForParallelWorkersToFinish(). While waiting for it, the leader can update its progress information. After the leader confirmed all index statuses became COMPLETED, it can wait for the workers to finish by WaitForParallelWorkersToFinish(). Regarding waiting in vacuum_delay_point, it might be a side effect as it’s called every page and used not only by vacuum such as analyze, but it seems to be worth trying. Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/
Commits
-
Report index vacuum progress.
- 46ebdfe164c6 17.0 landed
-
Add new parallel message type to progress reporting.
- f1889729dd3a 17.0 landed
-
Remove MaxBackends variable in favor of GetMaxBackends() function.
- aa64f23b0292 15.0 cited