Re: Another way to reduce pg_subtrans lookup overhead

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Another way to reduce pg_subtrans lookup overhead
Date: 2005-12-01 15:21:16
Message-ID: 10854.1133450476@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Tom Lane wrote:
>> I thought of a different approach to it, which is to make snapshot
>> checking take a hint from TransactionIdIsInProgress: use the subxid
>> caches from the PG_PROC array.

> Yeah, I had thought about using the XidCache while checking your other
> approach yesterday. I was thinking however not in saving the Xids in
> the snapshot, but using the ones already in PGPROC. Not sure if that is
> as useful, but looks like at least it would be able to reduce the
> probability of examining pg_subtrans in some cases without introducing
> extra cost.

How would that work? The ones in PGPROC, by the time you are examining
the snapshot, might have little to do with the ones that were valid at
the time the snap was taken. Another problem is that (AFAICS) you'd
have to lock the ProcArray to look at them, and the whole point of this
exercise is to avoid needing to lock shared data structures during
HeapTupleSatisfiesSnapshot.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonah H. Harris 2005-12-01 15:55:40 Re: generalizing the planner knobs
Previous Message Tom Lane 2005-12-01 15:07:31 Re: [PATCHES] A couple of proposed pgbench changes