Re: Multiple Xids in PGPROC?

Bruce Momjian <pgman@candle.pha.pa.us>

From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: Alvaro Herrera <alvherre@dcc.uchile.cl>, Hackers <pgsql-hackers@postgresql.org>
Date: 2004-05-05T04:02:14Z
Lists: pgsql-hackers
Christopher Kings-Lynne wrote:
> > I remember going through this.  Other backends will use pg_subtrans to
> > know what transactions are in progress. They have to do the standard
> > lookups to find the status of the parent transaction.  The backend-local
> > list of xids is needed so the commit can clean up those subtransaction
> > xids so that later transactions don't have to use pg_subtrans.
> 
> Is there some solution whereby the common case (99.999% of transactions 
> won't be subtransactoins) is fast, and the uncommon case of being in a 
> subtransaction is slower?

Yes, we use an unreserved clog status to indicate a pg_subtrans lookup
is required.  In non-subtrans cases, no pg_subtrans lookup is required.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073