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

From Andres Freund
Subject Re: Make HeapTupleSatisfiesMVCC more concurrent
Date
Msg-id 20150819140824.GB10770@awork2.anarazel.de
Whole thread Raw
In response to Re: Make HeapTupleSatisfiesMVCC more concurrent  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Make HeapTupleSatisfiesMVCC more concurrent  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Make HeapTupleSatisfiesMVCC more concurrent  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2015-08-18 20:36:13 -0400, Tom Lane wrote:
> I wrote:
> > Just thinking about this ... I wonder why we need to call
> > TransactionIdIsInProgress() at all rather than believing the answer from
> > the snapshot?  Under what circumstances could TransactionIdIsInProgress()
> > return true where XidInMVCCSnapshot() had not?
> 
> I experimented with the attached patch, which replaces
> HeapTupleSatisfiesMVCC's calls of TransactionIdIsInProgress with
> XidInMVCCSnapshot, and then as a cross-check has all the "return false"
> exits from XidInMVCCSnapshot assert !TransactionIdIsInProgress().

I'm not sure about it, but it might be worthwhile to add a
TransactionIdIsKnownCompleted() check before the more expensive parts of
XidInMVCCSnapshot(). Neither the array search nor, much more so, the
subtrans lookups are free.

- Andres



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: DBT-3 with SF=20 got failed
Next
From: Oleg Bartunov
Date:
Subject: Re: Proposal: Implement failover on libpq connect level.