Skip site navigation (1) Skip section navigation (2)

Re: autovacuum not prioritising for-wraparound tables

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>,Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: autovacuum not prioritising for-wraparound tables
Date: 2013-01-31 19:36:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Christopher Browne escribió:
> On Fri, Jan 25, 2013 at 12:00 PM, Andres Freund <andres(at)2ndquadrant(dot)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      
PostgreSQL Development, 24x7 Support, Training & Services

In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2013-01-31 19:40:14
Subject: Re: autovacuum not prioritising for-wraparound tables
Previous:From: Simon RiggsDate: 2013-01-31 19:33:53
Subject: Re: pgsql: Fast promote mode skips checkpoint at end of recovery.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group