Re: Make autovacuum sort tables in descending order of xid_age - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: Make autovacuum sort tables in descending order of xid_age
Date
Msg-id 49dac8e3-40bc-2986-e873-51f874c0f5fa@gmail.com
Whole thread Raw
In response to Re: Make autovacuum sort tables in descending order of xid_age  (Mark Dilger <hornschnorter@gmail.com>)
List pgsql-hackers

On 12/12/19 1:35 PM, Mark Dilger wrote:
>    Let C = 1.00000002065
>    Let x = xid_age for a table
>    Let v = clamp(n_dead_tuples / reltuples*2) to max 0.5
>    Let a = clamp(changes_since_analyze / reltuples) to max 0.5
> 
>    Let score = C**x + v + a

I should hasten to add that this is just a proof of concept
formula, not one that I'm specifically advocating.  The point
is that we can devise a scoring system in which the xid age
is the dominant factor whenever it could possibly matter,
while still letting other factors prevail when xid age is
of little consequence.

-- 
Mark Dilger



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: What constrains the range of SERIALIZABLEXACT xmin values?
Next
From: Peter Geoghegan
Date:
Subject: Re: Remove configure --disable-float4-byval and --disable-float8-byval