Re: Track skipped tables during autovacuum and autoanalyze

Yugo Nagata <nagata@sraoss.co.jp>

From: Yugo Nagata <nagata@sraoss.co.jp>
To: Michael Paquier <michael@paquier.xyz>
Cc: Sami Imseih <samimseih@gmail.com>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-27T07:35:49Z
Lists: pgsql-hackers

Attachments

On Fri, 27 Mar 2026 08:07:29 +0900
Michael Paquier <michael@paquier.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@sraoss.co.jp>