Re: Track skipped tables during autovacuum and autoanalyze

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Track skipped tables during autovacuum and autoanalyze
Date: 2026-05-15 20:21:01
Message-ID: CAN4CZFMtq1LeBYcfssA0uQ7zcu+WxiUudsS7z7mXCxWX+NXofA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Looks good and seems to handle the previous corner case, I only have
two very minor comments:

@@ -391,6 +392,7 @@ pgstat_report_skipped_vacuum_analyze(Oid relid, int flags)
return; /* somebody deleted the rel, forget it */
isshared = ((Form_pg_class) GETSTRUCT(classTup))->relisshared;
ReleaseSysCache(classTup);
+ INJECTION_POINT("expand-vacuum-rel-skip-locked", NULL);

Nitpick, but now that the injection point lives inside
pgstat_report_skipped_vacuum_analyze, it should be named accordingly.

+ * This mirrors the approach used in pgstat_init_function_usage() for
+ * functions.

pgstat_init_function_usage only drops the entry conditionally if it
was created immediately before, so it is not entirely the same
pattern, I'm not sure if I would say "mirrors". Maybe similar to? But
this is again just nitpick.

The flow there (pending_entry, created flag => only rechecking on
freshly created) has the advantage that it only runs
AcceptInvalidationMessages+recheck when needed, but here it would also
require an additional pgstat_lock_entry call.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-05-15 20:29:39 Re: Vacuumlo improvements
Previous Message Sami Imseih 2026-05-15 19:57:30 Re: [PATCH] doc: Document that invalid indexes are skipped during ATTACH PARTITION