Re: Idea for getting rid of VACUUM FREEZE on cold pages

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idea for getting rid of VACUUM FREEZE on cold pages
Date: 2010-05-27 18:49:25
Message-ID: AANLkTil6xfScg0nFQoEwzU5CT0LOWDjdS-8XtpKCoZ0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 27, 2010 at 2:17 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
> On 5/26/10 6:32 PM, Robert Haas wrote:
>> Hmm, yeah.  Maybe we should freeze when we set PD_ALL_VISIBLE; that
>> might be just as good, and simpler.  Assuming the visibility map is
>> sufficiently crash-safe/non-buggy, we could then teach VACUUM that
>> it's OK to advance relfrozenxid even when doing just a partial vacuum
>> - because any pages that were skipped must contain only frozen tuples.
>>  Previously you've objected to proposals in this direction because
>> they might destroy forensic information, but maybe we should do it
>> anyway.
>
> It would be an improvement, and easier than the various ways of never
> having to visit the pages, which are all fairly intensive.  Given the
> destruction of rollback information, though, we'd probably want a way to
> switch this behaviour on and off as an autovacuum setting.

It's not going to destroy anything that is needed for rollback unless
there's a bug - PD_ALL_VISIBLE only gets set when all tuples on the
page are visible to all backends. That can't happen until all
transactions that wrote the page, and all others that have a lower
xmin, have committed. That having been said, if making it a GUC makes
people less nervous about doing it, then +1 from me.

> Does this send us down the wrong path, though?  I thought we wanted to
> think about removing hint bits so that we could implement things like
> CRCs.  No?

PD_ALL_VISIBLE is a page-level bit, not a tuple-level bit, and I
strongly suspect it's not going anywhere. It's critical
infrastructure for index-only scans, among other things.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-05-27 18:52:42 Re: Idea for getting rid of VACUUM FREEZE on cold pages
Previous Message Robert Haas 2010-05-27 18:44:38 Re: JSON manipulation functions