Re: autovacuum not prioritising for-wraparound tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: autovacuum not prioritising for-wraparound tables
Date
Msg-id 20130131193647.GB4883@alvh.no-ip.org
Whole thread Raw
In response to Re: autovacuum not prioritising for-wraparound tables  (Christopher Browne <cbbrowne@gmail.com>)
Responses Re: autovacuum not prioritising for-wraparound tables
Re: autovacuum not prioritising for-wraparound tables
Re: autovacuum not prioritising for-wraparound tables
List pgsql-hackers
Christopher Browne escribió:
> On Fri, Jan 25, 2013 at 12:00 PM, Andres Freund <andres@2ndquadrant.com> wrote:

> I'd be inclined to do something a bit more sophisticated than just
> age(relfrozenxid) for wraparound; I'd be inclined to kick off large tables'
> wraparound vacuums earlier than those for smaller tables.
>
> With a little bit of noodling around, here's a thought for a joint function
> that I *think* has reasonably common scales:
>
> f(deadtuples, relpages, age) =
>    deadtuples/relpages + e ^ (age*ln(relpages)/2^32)

Okay, here's a patch along these lines.  I haven't considered Jim's
suggestion downthread about discounting dead tuples from relpages; maybe
we can do that by subtracting the pages attributed to dead ones,
estimating via tuple density (reltuples/relpages).  But that's no my
main concern here.

Instead, what I propose (and is not really in the patch), as a
backpatchable item, is an approach in which the functions to compute
each rel's Browne strength and sort are hooks.  Normal behavior is not
to sort at all, as currently, and sites that have a problem with the
current random order can install a custom module that provide hooks to
change ordering as they see fit.  So behavior won't change for people
who have no problem today.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strange Windows problem, lock_timeout test request
Next
From: Alvaro Herrera
Date:
Subject: Re: autovacuum not prioritising for-wraparound tables