Re: another autovacuum scheduling thread

From: Robert Treat <rob(at)xzilla(dot)net>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Sami Imseih <samimseih(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jeremy Schneider <schneider(at)ardentperf(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: another autovacuum scheduling thread
Date: 2025-11-11 19:43:19
Message-ID: CABV9wwM_Q9+-AXga=t=RPXMYHRNoRK_UEqXy-Q8_=WcOjJ=iAw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 11, 2025 at 11:36 AM Nathan Bossart
<nathandbossart(at)gmail(dot)com> wrote:
>
> Still catching up on the latest discussion, but here's a v8 patch that
> amends the DEBUG3 in relation_needs_vacanalyze() to also log the score. I
> might attempt to add some sort of brief documentation about autovacuum
> prioritization next.
>
> From skimming the latest discussion, I gather we might want to consider
> re-sorting the list periodically. Is the idea that we'll re-sort the
> remaining tables in the list, or that we'll basically restart
> do_autovacuum()? If it's the latter, then we'll need to come up with some
> way to decide when to stop for the current database. Right now, we just go
> through pg_class and call it a day.
>

FWIW, when I have built these types of systems in the past, and when I
wanted an aggressive recheck-type mechanism, the most common methods
involved tying it to autovacuum_max_workers. This usually was done
under the assumption that generating the list was relatively cheap and
that higher xid age would generate higher priority candidates. Of
course I also was biased towards having it be user controllable at the
database level (ie. no need to modify some control file or cron job or
whatever). To the degree those things are aligned here, there is at
least some anecdata that this is a usable setting.

Robert Treat
https://xzilla.net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-11-11 19:46:59 Re: vacuumdb: add --dry-run
Previous Message Nathan Bossart 2025-11-11 19:28:08 Re: Improve LWLock tranche name visibility across backends