Re: another autovacuum scheduling thread
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Jeremy Schneider <schneider@ardentperf.com>, Sami Imseih <samimseih@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-10-22T18:40:11Z
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
On Wed, Oct 22, 2025 at 09:07:33AM +1300, David Rowley wrote: > However, just thinking of non-standard setting... I do wonder if it'll > be aggressive enough if someone did something like raise the > *freeze_max_age to 1 billion (it's certainly common that people raise > this). With a 1.6 billion vacuum_failsafe_age, a table at > freeze_max_age only scores in at 110. I guess there's no reason we > couldn't keep your calc and then scale the score further once over > vacuum_failsafe_age to ensure those are the highest priority. There is > a danger that if a table scores too low when age(relfrozenxid) > > vacuum_failsafe_age that autovacuum dawdles along handling bloated > tables while oblivious to the nearing armageddon. That's a good point. I wonder if we should try to make the wraparound score independent of the *_freeze_max_age parameters (once the table age surpasses said parameters). Else, different settings will greatly impact how aggressively tables are prioritized the closer they are to wraparound. Even if autovacuum_freeze_max_age is set to 200M, it's not critically important for autovacuum to pick up tables right away as soon as their age reaches 200M. But if the parameter is set to 2B, we _do_ want autovacuum to prioritize tables right away once their age reaches 2B. > Is it worth writing a comment explaining the philosophy behind the > scoring system to make it easier for people to understand that it aims > to standardise the priority of vacuums and unify the various trigger > thresholds into a single number to determine which tables are most > important to vacuum and/or analyze first? Yes, I think so. > Thanks for working on this. I appreciate the discussion. -- nathan