Re: logical decoding - GetOldestXmin - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: logical decoding - GetOldestXmin
Date
Msg-id CA+U5nMJKy=8qjJNNCpr1j=CXOZ=5P4nk-3qR8KM+sVEe02v-VQ@mail.gmail.com
Whole thread Raw
In response to Re: logical decoding - GetOldestXmin  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: logical decoding - GetOldestXmin
List pgsql-hackers
On 13 December 2012 22:37, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2012-12-13 17:29:06 -0500, Robert Haas wrote:
>> On Thu, Dec 13, 2012 at 3:03 PM, Andres Freund <andres@2ndquadrant.com> wrote:
>> > It moves a computation of the sort of:
>> >
>> > result -= vacuum_defer_cleanup_age;
>> > if (!TransactionIdIsNormal(result))
>> >    result = FirstNormalTransactionId;
>> >
>> > inside ProcArrayLock. But I can't really imagine that to be relevant...
>>
>> I can.  Go look at some of the 9.2 optimizations around
>> GetSnapshotData().  Those made a BIG difference under heavy
>> concurrency and they were definitely micro-optimization.  For example,
>> the introduction of NormalTransactionIdPrecedes() was shockingly
>> effective.
>
> But GetOldestXmin() should be called less frequently than
> GetSnapshotData() by several orders of magnitudes. I don't really see
> it being used in any really hot code paths?

Maybe, but that calculation doesn't *need* to be inside the lock, that
is just a consequence of the current coding.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Use of systable_beginscan_ordered in event trigger patch
Next
From: Josh Kupershmidt
Date:
Subject: Re: Multiple --table options for other commands