Re: another autovacuum scheduling thread

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Jeremy Schneider <schneider(at)ardentperf(dot)com>, Sami Imseih <samimseih(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: another autovacuum scheduling thread
Date: 2025-10-09 16:13:48
Message-ID: aOffPCBoQLG5dGd8@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 09, 2025 at 04:13:23PM +1300, David Rowley wrote:
> I think the best way to understand it is if you look at
> relation_needs_vacanalyze() and see how it calculates boolean values
> for boolean output params. So, instead of calculating just a boolean
> value it instead calculates a float4 where < 1.0 means don't do the
> operation and anything >= 1.0 means do the operation. For example,
> let's say a table has 600 dead rows and the scale factor and threshold
> settings mean that autovacuum will trigger at 200 (3 times more dead
> tuples than the trigger point). That would result in the value of 3.0
> (600 / 200). The priority for relfrozenxid portion is basically
> age(relfrozenxid) / autovacuum_freeze_max_age (plus need to account
> for mxid by doing the same for that and taking the maximum of each
> value). For each of those component "scores", the priority for
> autovacuum would be the maximum of each of those.
>
> Effectively, it's a method of aligning the different units of measure,
> transactions or tuples into a single value which is calculated based
> on the very same values that we use today to trigger autovacuums.

I like the idea of a "score" approach, but I'm worried that we'll never
come to an agreement on the formula to use. Perhaps we'd have more luck
getting consensus on a multifaceted strategy if we kept it brutally simple.
IMHO it's worth a try...

--
nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-10-09 16:15:31 Re: another autovacuum scheduling thread
Previous Message Álvaro Herrera 2025-10-09 16:12:59 Re: compiling pg_bsd_indent