Re: [PATCH] Lazy xid assingment V2 - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: [PATCH] Lazy xid assingment V2
Date
Msg-id 87lkbr45to.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: [PATCH] Lazy xid assingment V2  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Lazy xid assingment V2  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] Lazy xid assingment V2  ("Florian G. Pflug" <fgp@phlo.org>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> "Florian G. Pflug" <fgp@phlo.org> writes:
>> Tom Lane wrote:
>>> I don't much like this, since as I mentioned before I don't think
>>> MyProc->xmin is going to be constant over a whole transaction for
>>> long.  I don't think xid_age is performance-critical in any way,
>>> so I'd vote for letting it force XID assignment.
>
>> Hm... I agree that xid_age is probably not performance-critical.
>> I guess it's more the complete counter-intuitivity of forcing
>> xid assignment in some arbitrary function thats bugging me a bit.
>
> Well, I don't see it as arbitrary --- we're trying to hide the fact that
> XIDs are assigned lazily from user-visible behavior.

It seems both this and some of the other cases of having to call
ReadNewTransactionId would be eliminated if we invented a new xid treated
similarly to current_time() and others which are calculated once per
transaction and then cached for subsequent accesses. So xid_age() would
measure relative to a fixed xid, it just wouldn't be *our* xid necessarily.

Just a thought.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Lazy xid assingment V2
Next
From: Gregory Stark
Date:
Subject: Re: pgsql: Apply a band-aid fix for the problem that 8.2 and up completely