Re: TransactionIdIsInProgress() cache

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: TransactionIdIsInProgress() cache
Date: 2008-03-11 13:07:48
Message-ID: 20080311130748.GE6767@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

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 */
}

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Pavan Deolasee 2008-03-11 13:18:14 Re: TransactionIdIsInProgress() cache
Previous Message Pavan Deolasee 2008-03-11 13:06:33 Re: [PERFORM] Very slow (2 tuples/second) sequential scan after bulk insert; speed returns to ~500 tuples/second after commit