public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dilip Kumar <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Robert Treat <[email protected]>
Cc: David Rowley <[email protected]>
Cc: Sami Imseih <[email protected]>
Cc: Jeremy Schneider <[email protected]>
Cc: [email protected]
Subject: Re: another autovacuum scheduling thread
Date: Sat, 22 Nov 2025 18:37:36 +0530
Message-ID: <CAFiTN-uk1Khy8FYkefHk2Txb4fNtUrvtaKBab=G9cSnE_VywFA@mail.gmail.com> (raw)
In-Reply-To: <aR9BATffJN-hmQ1w@nathan>
References: <CAApHDvq_j+GVqX_ZAmvn236Mgg5OYQ6_s9kVsyoo1tJa2RJ=2w@mail.gmail.com>
	<CAA5RZ0udjEYJupob5tv3286e28bMpajgsy+4nAbxg73YyigZFw@mail.gmail.com>
	<CAApHDvq9ecYSetXUhjMc7E_Jcc7gxxRkA0LosX9PP1-jM_Ak8A@mail.gmail.com>
	<aRNmEPQ18qZlLowV@nathan>
	<CAApHDvrtvMF3_W69hOUr2SnbizjC1jc68_Ca0nPYr=+VUkUkAw@mail.gmail.com>
	<aROY-MUVO_mYTl2f@nathan>
	<CAApHDvpo3YxiaP123vghHL-aLkY2vc-e1scpDSpaTFWz1qVaQA@mail.gmail.com>
	<CABV9wwOcD4RM5Hm0d+=KBK8LyHLtEtF3YZ4ak8V3VvOYV9Z4Tw@mail.gmail.com>
	<aRTpqMleDpoQm9OO@nathan>
	<CA+TgmoY27S+nbgdCrVrc8S4p38NwTAC8_Uyq5ZaX6zxYToebXA@mail.gmail.com>
	<aR9BATffJN-hmQ1w@nathan>

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





view thread (143+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: another autovacuum scheduling thread
  In-Reply-To: <CAFiTN-uk1Khy8FYkefHk2Txb4fNtUrvtaKBab=G9cSnE_VywFA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox