Re: another autovacuum scheduling thread
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Robert Treat <rob@xzilla.net>, David Rowley <dgrowleyml@gmail.com>, Sami Imseih <samimseih@gmail.com>, Jeremy Schneider <schneider@ardentperf.com>, pgsql-hackers@postgresql.org
Date: 2025-11-22T13:07:36Z
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 Thu, Nov 20, 2025 at 9:55 PM Nathan Bossart <nathandbossart@gmail.com> wrote: > Thanks for working on this problem, We frequently hear about the auto vacuuming scheduling issue. I believe this is a great starting point to prioritize based on the wraparound and vacuum threshold limit. However, my vision for addressing this problem has always involved maintaining two distinct priority queues (or sorted lists). Each of these queues would contain tables, with the tables within each queue sorted by their respective scores. Queue 1: Wraparound-Critical: This queue contains tables that require immediate action because their XID or MultiXact ID age is critical, especially those approaching the failsafe limit. Queue 2: Threshold-Based: This queue includes tables needing VACUUM due to crossing other thresholds. Both queues would be maintained as sorted lists, with the highest priority score at the head. The autovacuum worker dynamically selects tables for processing from the head of these 2 queues. For instance, if a table is initially chosen from the threshold queue but processing took too long, and another table approaches its failsafe limit due to a high rate of concurrent XID generation, the latter can be prioritized from the wraparound queue. I believe this 2 queue approach offers more flexibility than attempting to merge these distinct concerns into a single scoring dimension. Tables may exist in both queues. If a table is selected and vacuumed, it will be removed from both queues to prevent redundant efforts. -- Regards, Dilip Kumar Google