Re: Another way to reduce pg_subtrans lookup overhead - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Another way to reduce pg_subtrans lookup overhead
Date
Msg-id 10854.1133450476@sss.pgh.pa.us
Whole thread Raw
In response to Re: Another way to reduce pg_subtrans lookup overhead  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] A couple of proposed pgbench changes
Next
From: "Jonah H. Harris"
Date:
Subject: Re: generalizing the planner knobs