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 http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
In response to
pgsql-hackers by date
|Next:||From: Alvaro Herrera||Date: 2013-01-31 19:40:14|
|Subject: Re: autovacuum not prioritising for-wraparound tables|
|Previous:||From: Simon Riggs||Date: 2013-01-31 19:33:53|
|Subject: Re: pgsql: Fast promote mode skips checkpoint at end of recovery.|