Re: Make HeapTupleSatisfiesMVCC more concurrent - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Make HeapTupleSatisfiesMVCC more concurrent
Date
Msg-id 20150825210126.GK2912@alvherre.pgsql
Whole thread Raw
In response to Re: Make HeapTupleSatisfiesMVCC more concurrent  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Amit Kapila <amit.kapila16@gmail.com> writes:

> > I am wondering that is there any harm in calling TransactionIdDidAbort()
> > in slow path before calling SubTransGetTopmostTransaction(), that can
> > also maintain consistency of checks in both the functions?
> 
> I think this is probably a bad idea.  It adds a pg_clog lookup that we
> would otherwise not do at all, in hopes of avoiding a pg_subtrans lookup.
> It's not exactly clear that that's a win even if we successfully avoid
> the subtrans lookup (which we often would not).  And even if it does win,
> that would only happen if the other transaction has aborted, which isn't
> generally the case we prefer to optimize for.

It's probably key to this idea that TransactionIdDidAbort returns in a
single slru lookup, whereas SubTransGetTopmostTransaction needs to
iterate possibly many layers of subxacts.  But the point about this
being a win only for aborted xacts makes it probably pointless, I agree.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Make HeapTupleSatisfiesMVCC more concurrent
Next
From: Tom Lane
Date:
Subject: Re: 9.4 broken on alpha