Re: TransactionIdIsInProgress() cache

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: TransactionIdIsInProgress() cache
Date: 2008-03-11 20:28:49
Message-ID: 5338.1205267329@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> We currently have a single item cache of the last checked TransactionId,
> which optimises the call to TransactionIdDidCommit() during
> HeapTupleSatisfiesMVCC() and partners.

> Before we call TransactionIdDidCommit() we always call
> TransactionIdIsInProgress().

> TransactionIdIsInProgress() doesn't check the single item cache, so even
> if we have just checked for this xid, we will check it again. Since this
> function takes ProcArrayLock and may be called while holding other locks
> it will improve scalability if we can skip the call, for the cost of an
> integer comparison.

> Following patch implements fastpath in TransactionIdIsInProgress() to
> utilise single item cache.

Applied with minor adjustments and some desultory comment-improvement.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2008-03-11 21:06:27 Re: Load Distributed Checkpoints, final patch
Previous Message Bruce Momjian 2008-03-11 20:05:01 Re: Sorted writes in checkpoint