Re: autovacuum not prioritising for-wraparound tables

From: Jim Nasby <jim(at)nasby(dot)net>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Christopher Browne <cbbrowne(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, 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-30 22:44:34
Message-ID: 5109A252.6000108@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/30/13 3:28 PM, Kevin Grittner wrote:
> Jim Nasby <jim(at)nasby(dot)net> wrote:

>> then the *ideal* time to start a freeze vacuum on a table is so
>> that the vacuum would end *exactly* as we were about to hit XID
>> wrap.
>
> For a tuple which you know is going to survive long enough to be
> frozen, the *ideal* time to freeze a tuple, from a performance
> standpoint, is when the tuple is written, to eliminate a separate
> WAL-log operation. The *next best* time to freeze is when the hint
> bits are set, to avoid a separate page write. If you are doing
> differential backups, the *third best* time to freeze is before the
> first differential backup of the tuple, to avoid a separate backup
> after the freeze. And so on.

Yeah, I hadn't considered that aspect, but I think that's a separate
discussion. I agree that there are many cases where we would benefit
from freezing early, and those should all help reduce the impact of
XID-wrap induced freezing.

Even if we do introduce "up-front" freezing, we still need to deal with
all the other cases though, which in the worst case means avoiding the
XID wrap. I believe that particular case (as well as the whole autovac
priority question) would be best served by looking at 1st and 2nd order
derivatives.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2013-01-30 22:50:22 Re: autovacuum not prioritising for-wraparound tables
Previous Message MauMau 2013-01-30 22:41:23 Re: backend hangs at immediate shutdown (Re: Back-branch update releases coming in a couple weeks)