Re: Make HeapTupleSatisfiesMVCC more concurrent

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Make HeapTupleSatisfiesMVCC more concurrent
Дата
Msg-id 20150819140824.GB10770@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: Make HeapTupleSatisfiesMVCC more concurrent  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Make HeapTupleSatisfiesMVCC more concurrent  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Make HeapTupleSatisfiesMVCC more concurrent  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: DBT-3 with SF=20 got failed
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Proposal: Implement failover on libpq connect level.