Re: Add pg_stat_autovacuum_priority
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Robert Treat <rob@xzilla.net>, satyanarlapuram@gmail.com, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-04-04T16:33:09Z
Lists: pgsql-hackers
Attachments
On Sat, Apr 04, 2026 at 10:32:07AM -0500, Sami Imseih wrote: >> On Sat, Apr 04, 2026 at 08:25:26AM -0500, Sami Imseih wrote: >> > "Scores greater than or equal to <literal>1.0</literal>" in the comments >> > of each field are misleading. This conflates scoring with vacuum/analyze >> > eligibility and it's possible with a autovacuum_*_weight < 1.0 to trigger an >> > autovacuum/analyze. >> >> Ah, that's unfortunate. I think it'd be good to give folks some idea of >> what autovacuum will actually process. I wonder if we could adjust the >> documentation accordingly. > > That's why I thought having the bool fields made sense in the earlier > versions of the view. Since autovacuum is dealing with 2 concepts: > > eligibility: is av enabled and is the table meeting thresholds > score: The priority of how the eligible tables will be processed. > > So, while this could be explained in docs, I think it's better we report > these fields. I understand your position, but I still worry about potential confusion if when dovacuum and needs_vacuum differ. And I don't know how much we really ought to be tailoring this stuff to clusters where autovacuum is disabled or where the scores are being adjusted. Also, I think we ought to go into more detail in the documentation, anyway. So my instinct was to do something more like the attached. If we did report booleans, I would probably argue for just reporting dovacuum and doanalyze and calling out the criteria for why they may be false even when it looks like the table needs processing. -- nathan
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix double-free in pg_stat_autovacuum_scores.
- 71ff232a5bc4 19 (unreleased) landed
-
Add LOG_NEVER error level code.
- 60165db6e1f2 19 (unreleased) landed
-
Add pg_stat_autovacuum_scores system view.
- 87f61f0c8280 19 (unreleased) landed
-
Remove recheck_relation_needs_vacanalyze().
- 775fe51daaef 19 (unreleased) landed
-
Add elevel parameter to relation_needs_vacanalyze().
- 01876ace1369 19 (unreleased) landed
-
Teach relation_needs_vacanalyze() to always compute scores.
- 53b8ca6881a1 19 (unreleased) landed
-
Refactor relation_needs_vacanalyze().
- 8261ee24fe33 19 (unreleased) landed
-
Add rudimentary table prioritization to autovacuum.
- d7965d65fc5b 19 (unreleased) cited
-
Fix per-relation memory leakage in autovacuum.
- 02502c1bca54 18.0 cited
-
Fix recently-understood problems with handling of XID freezing, particularly
- 48188e1621bb 8.2.0 cited