On Thu, Nov 20, 2025 at 9:55 PM Nathan Bossart <[email protected]> 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
