Re: Track skipped tables during autovacuum and autoanalyze

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Track skipped tables during autovacuum and autoanalyze
Date: 2026-03-27 07:35:49
Message-ID: 20260327163549.b5df519c0099970ddbb3412d@sraoss.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 27 Mar 2026 08:07:29 +0900
Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Thu, Mar 26, 2026 at 07:22:03PM +0900, Yugo Nagata wrote:
> > To handle the possibility that the table is dropped between
> > RangeVarGetRelid() and the lock attempt, SearchSysCacheExists1() is
> > used after acquiring the lock.
>
> (Noticed while skimming through my emails this morning..)
>
> +void
> +pgstat_report_skipped_vacuum_analyze(Oid relid, bool vacuum, bool analyze,
> + bool autovacuum)
>
> I'd recommend to replace this interface with three booleans with a set
> of three bitwise flags. That would be less error prone for the
> callers of this function, or we could finish by aggregating counters
> we don't want to.

Thank you for the suggestion.
I've attached a revised patch reflecting this change, and it also includes
the documentation.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v3-0001-Track-skipped-vacuum-and-analyze-activity-per-rel.patch text/x-diff 23.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-03-27 07:38:45 Re: Enable -Wstrict-prototypes and -Wold-style-definition by default
Previous Message Lukas Fittl 2026-03-27 07:21:23 Re: Stack-based tracking of per-node WAL/buffer usage