Skip site navigation (1) Skip section navigation (2)

Re: TransactionIdIsInProgress() cache

From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, "Simon Riggs" <simon(at)2ndquadrant(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: TransactionIdIsInProgress() cache
Date: 2008-03-11 13:18:14
Message-ID: 2e78013d0803110618x4dbbc67fg5f7863f027ce6cf4@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-patches
On Tue, Mar 11, 2008 at 6:37 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
> I didn't check whether your transformation is correct, but if so then it
>  can be changed like this and save the extra XidDidCommit call:
>
>     xvac_committed = TransactionIdDidCommit(xvac);
>     if (xvac_committed)
>
>     {
>         /* committed */
>     }
>     else if (!TransactionIdIsInProgress(xvac))
>     {
>        if (xvac_committed)
>
>        {
>           /* committed */
>        }
>        else
>        {
>           /* aborted */
>        }
>     }
>     else
>     {
>         /* in-progress */
>     }
>


I doubt if the transformation is correct. If xvac_committed is true, why would
one even get into the else part ?

Thanks,
Pavan

-- 
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

In response to

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2008-03-11 13:29:04
Subject: Re: [PERFORM] Very slow (2 tuples/second) sequentialscan after bulk insert; speed returns to ~500 tuples/second aftercommit
Previous:From: Alvaro HerreraDate: 2008-03-11 13:07:48
Subject: Re: TransactionIdIsInProgress() cache

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group