Re: logical decoding - GetOldestXmin

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Peter Geoghegan <peter(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: logical decoding - GetOldestXmin
Date: 2012-12-16 17:02:35
Message-ID: 20121216170235.GH4683@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2012-12-16 16:44:04 +0000, Simon Riggs wrote:
> On 13 December 2012 20:03, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>
> > Does anybody have an opinion on the attached patches? Especially 0001,
> > which contains the procarray changes?
> >
> > 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 don't see why this is hard.
>
> Just make the lock acquisition/release conditional on another parameter.
>
> That way the only thing you'll be moving inside the lock is an if test
> on a constant boolean.

Thats not really cheaper. Two branches + additional parameter
passed/pushed vs one branch, one subtransaction, two assignments is a
close call.
As I don't think either really matters in the GetOldestXmin case, I
would be happy with that as well. If people prefer an additional
parameter + adjusting the few callsite vs. a separate function I will go
that way.

Greetings,

Andres Freund

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2012-12-16 17:21:28 Re: small pg_basebackup display bug
Previous Message Simon Riggs 2012-12-16 16:44:04 Re: logical decoding - GetOldestXmin