Re: Add mode column to pg_stat_progress_vacuum

From: Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Robert Treat <rob(at)xzilla(dot)net>, pgsql-hackers(at)postgresql(dot)org, Sami Imseih <samimseih(at)gmail(dot)com>
Subject: Re: Add mode column to pg_stat_progress_vacuum
Date: 2025-10-09 11:35:54
Message-ID: CAOzEurSkrS3FYbz7mKgTKTwgmx=FWKu=n9FhqKesvOSmdAbbWw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 8, 2025 at 4:34 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Tue, Oct 7, 2025 at 12:01 PM Nathan Bossart <nathandbossart(at)gmail(dot)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.

Thanks for the clarification. I agree with your proposal. Separating
the "reason" from the "mode" into two columns is a great idea that
will provide much clearer insight for DBAs.

--
Best regards,
Shinya Kato
NTT OSS Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mingli Zhang 2025-10-09 11:47:09 Re: Add downloaded files to gitignore
Previous Message Shinya Kato 2025-10-09 11:31:57 Re: Add mode column to pg_stat_progress_vacuum