On Wed, Sep 14, 2005 at 11:30:52PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.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)