Re: Per-table freeze limit proposal

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Per-table freeze limit proposal
Date: 2005-09-15 19:21:34
Message-ID: 20050915192134.GC28370@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, Sep 14, 2005 at 11:30:52PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> > In fact this seems pretty easy to do. Add a field to pg_class, tell
> > VACUUM to update it using the determined freezeLimit, and that's it.
>
> I think that it'd be worth fixing things so that the recorded value
> is not the freeze cutoff value (as now), but the actual lowest
> not-frozen XID present anywhere in the table.

Cool. I wonder if the exact figure should be

min(lowest non-frozen Xid in table, GetOldestXmin(false))

just in case a long-running transaction inserts a new tuple after the
vacuum is done. Also GetOldestXmin should be the value used for empty
tables. For shared relations, we'd use GetOldestXmin(true).

Also, in light of this, it seems a bad idea to use the name "freezexid"
for the pg_class column; I would name it relminxid or something like
that (suggestions welcome). Not sure about renaming the pg_database
column -- I don't see why not.

--
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
"La Primavera ha venido. Nadie sabe como ha sido" (A. Machado)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-15 19:30:56 Re: Per-table freeze limit proposal
Previous Message Merlin Moncure 2005-09-15 14:57:05 Re: pgplsql temporary tables

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-09-15 19:30:56 Re: Per-table freeze limit proposal
Previous Message Jim Buttafuoco 2005-09-15 11:46:26 Re: Per-table freeze limit proposal