Re: Add mode column to pg_stat_progress_vacuum
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Robert Treat <rob@xzilla.net>, Shinya Kato <shinya11.kato@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-10-07T19:34:01Z
Lists: pgsql-hackers
On Tue, Oct 7, 2025 at 12:01 PM Nathan Bossart <nathandbossart@gmail.com> wrote: > > On Tue, Oct 07, 2025 at 10:17:38AM -0700, Masahiko Sawada wrote: > > Right. I think we cannot display both things in one mode column. Since > > both manual vacuums and anti-wraparound autovacuums can enter the > > failsafe mode dynamically, if we show "failsafe" in the mode column, > > we would lose the information "why is this vacuum running". I guess we > > would need separate columns. For example, I guess that the column > > showing "how is it operating under the hood" can have three values: > > "normal", "aggressive" (disables VM optimization), and "failsafe" > > (implies aggressive vacuum and disables many things to prioritize XID > > freezing). > > Am I understanding correctly that your idea is to have a "reason" column > that would have values like "manual", "normal autovacuum", and "autovacuum > for wraparound", and a "mode" column that would have values like "normal", > "agressive", and "failsafe"? Right. The first column provides an insight into whether or not the running vacuum is cancellable, and the second column provides information on how vacuums are actually processing tables under the hood. Users are able to get the former information by checking pg_stat_activity too but the latter information is available only in server logs. > I wonder if we could be even more granular > for the "normal autovacuum" case and point to the reason the table was > chosen. For example, was it the insert threshold, the update/delete > threshold, etc.? Sounds like reasonable information. I guess we might want to have such information in a cumulative statistics view but do you think it's better to have it in a dynamic statistics view? Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add started_by column to pg_stat_progress_analyze view.
- ab40db3852df 19 (unreleased) landed
-
Add mode and started_by columns to pg_stat_progress_vacuum view.
- 0d7895206198 19 (unreleased) landed