Re: another autovacuum scheduling thread
Sami Imseih <samimseih@gmail.com>
From: Sami Imseih <samimseih@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>,
Robert Haas <robertmhaas@gmail.com>, Jeremy Schneider <schneider@ardentperf.com>, pgsql-hackers@postgresql.org
Date: 2025-11-11T20:53:55Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add rudimentary table prioritization to autovacuum.
- d7965d65fc5b 19 (unreleased) landed
-
Trigger more frequent autovacuums with relallfrozen
- 06eae9e6218a 18.0 cited
-
Harden nbtree page deletion.
- c34787f91058 14.0 cited
-
Check for interrupts inside the nbtree page deletion code.
- 3a01f68e35a3 12.0 cited
> > The thing I’m hoping to address is something I’ve seen many times in practice. > > Autovacuum workers can get stuck on specific large or slow tables, and when > > that happens, users often end up running manual vacuums on those tables > > just to keep things moving for the smaller/faster vacuumed tables. > > > > Now, I am not so sure any type of autovacuum prioritization could actually > > help in these cases. What does help is adding more autovacuum workers. > > Thanks for explaining. I think the scoring system in Nathan's patch > helps with this as any smaller table which are neglected continue to > bloat, and because they're smaller, the score will increase more > quickly, That is true. > Maybe we can have it configurable so that 1 worker can be > configured to not work on tables above a given size, so there's at > least 1 worker that is less likely to be tied up for extended periods > of time. I don't know if that's a good idea, and also don't know what > realistic values for "given size" are. Another approach will be to signal for more autovacuum workers to be spun up ( user can have a minimum and max workers ) if all workers has been processing the list for a long time ( Also not sure what the long threshold would be ). This "auto-tuning" of workers could perhaps reduce the need for manual vacuums. It will still not prevent all workers from being tied up, but maybe reduce the likelihood. -- Sami