Lazy xid assignment V3

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Lazy xid assignment V3
Date: 2007-09-03 02:18:03
Message-ID: 46DB6EDB.80608@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

I tried sending this with the actual patch attached - this time,
to pgsql-pacthes, but it seems that my mail didn't get through again.
So it've put up the patch here: http://soc.phlo.org/lazyxidassign.v3.patch

----------------------------------------
Hi

Here is an updated version of my patch. This is pretty much equivalent
to the version V2, apart from the few minor things Tom criticized. The
changes are.

.) elog(ERROR) instead of Assert if there are to-be-deleted files, but
no XID assigned on commit

.) ResourceOwnerId is renamed to VirtualTransactionId.

.) GetOldestXmin() checks GetTopTransactionIdIfAny() first, and only
reverts to ReadNewTransactionId() if the former returns
InvalidTransactionId.

Since we didn't really reach an agreement on how xid_age should behave,
I've reverted it back to the original version. So with this patch,
xid_age will just force assignment of a xid. The other proposed ideas
where

.) Use some cached xid value which is kept stable for the duration of
a transaction.
.) Use RecentGlobalXmin. This makes the notion of xid age consistent with
VACCUM. The value could change between statements though (for
read-committed transactions).
.) Use the current snaphot's xmax. This would be the closest possible
approximation of using ReadNewTransasctionId() that keeps the xid age
constant during a statement or transaction. (Depending on the xact being
read-committed or serializable).

greetings, Florian Pflug

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-09-03 11:46:10 tsearch refactorings
Previous Message Tom Lane 2007-09-02 02:26:06 WIP patch for per-function GUC settings