Re: Add index scan progress to pg_stat_progress_vacuum
Sami Imseih <simseih@amazon.com>
From: "Imseih (AWS), Sami" <simseih@amazon.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Robert Haas <robertmhaas@gmail.com>, "Bossart, Nathan" <bossartn@amazon.com>, Peter Geoghegan <pg@bowt.ie>, Justin
Pryzby <pryzby@telsasoft.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-12-13T04:40:02Z
Lists: pgsql-hackers
Thanks for the feedback. I agree with the feedback, except for > need to have ParallelVacuumProgress. I see > parallel_vacuum_update_progress() uses this value but I think it's > better to pass ParallelVacuumState to via IndexVacuumInfo. I was trying to avoid passing a pointer to ParallelVacuumState in IndexVacuuminfo. ParallelVacuumProgress is implemented in the same way as VacuumSharedCostBalance and VacuumActiveNWorkers. See vacuum.h These values are reset at the start of a parallel vacuum cycle and reset at the end of an index vacuum cycle. This seems like a better approach and less invasive. What would be a reason not to go with this approach? > parallel_vacuum_update_progress() is typically called every 1GB so I > think we don't need to worry about unnecessary update. Also, I think > this code doesn't work when pgstat_track_activities is false. Instead, > I think that in parallel_wait_for_workers_to_finish(), we can check > the value of pvs->nindexes_completed and update the progress if there > is an update or it's first time. I agree that we don’t need to worry about unnecessary updates in parallel_vacuum_update_progress since we are calling every 1GB. I also don't think we should do anything additional in parallel_wait_for_workers_to_finish since here we are only updating every 1 second. Thanks, Sami Imseih Amazon Web Services
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