Re: Track skipped tables during autovacuum and autoanalyze

From: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
To: Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Track skipped tables during autovacuum and autoanalyze
Date: 2026-09-16 15:30:44
Message-ID: CAN12+YLDPuW8iF=UqXyLzmjM9MkHbx2YwwKq+8G2-HcO8Kzyfg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Tue, Sep 15, 2026 at 4:43 AM Sami Imseih <samimseih(dot)pg(at)gmail(dot)com> wrote:
> > This is less about stats reporting and more about filtering out such
> > relations earlier in expand_vacuum_rel() for manually specified
> > VACUUM/ANALYZE targets. Not a big thing, but it would avoid an extra
> > syscache lookup and a misleading "lock not available" warning.
>
> I would like to fold one more case into that follow-up. The skip is
> reported before vacuum_is_permitted_for_relation(), so a user with no
> rights on the table can still move its counters.
>
> The callback argument of RangeVarGetRelidExtended() looks like the
> right place for all of this. It runs before the lock attempt, and the
> comment there already says that is where permission checks belong. It
> also hands us relId, so expand_vacuum_rel() would no longer need the
> second RangeVarGetRelid(..., NoLock, true) lookup.

It may be worth cleaning this stuff up if someone is interested in taking
this on.

v16 is just a rebase. I also took out the catversion change for now, but made
it clear it's required in the commit message.

--
Sami Imseih
Amazon Web Services (AWS)

Attachment Content-Type Size
v16-0001-Track-skipped-vacuum-and-analyze-activity-per-re.patch application/octet-stream 46.3 KB
v16-0002-Add-injection-point-test-for-vacuum-skip_locked-.patch application/octet-stream 7.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Atsushi Ogawa 2026-09-16 15:37:38 Re: [PATCH] Use Boyer-Moore-Horspool for simple LIKE contains patterns
Previous Message Hannu Krosing 2026-09-16 15:15:41 Re: ANSI SQL proposal: SELECT DISTINCT ON (... ORDER BY ...) and UNION DISTINCT ON (... ORDER BY ...)