Re: testing HS/SR - 1 vs 2 performance - Mailing list pgsql-hackers

From Tom Lane
Subject Re: testing HS/SR - 1 vs 2 performance
Date
Msg-id 20633.1272237528@sss.pgh.pa.us
Whole thread Raw
In response to Re: testing HS/SR - 1 vs 2 performance  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: testing HS/SR - 1 vs 2 performance  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> [ v2 patch ]

I've been studying this some more while making notes for improved
comments, and I've about come to the conclusion that having readers
move the tail pointer (at the end of KnownAssignedXidsGetAndSetXmin)
is overly tricky and probably not a performance improvement anyway.
The code is in fact wrong as it stands: it's off-by-one about setting
the new tail value.  And there's potential for contention with multiple
readers all wanting to move the tail pointer at once.  And most
importantly, KnownAssignedXidsSearch can't move the tail pointer so
we might expend many inefficient searches while never moving the tail
pointer.

I think we should get rid of that and just have the two functions that
can mark entries invalid (which they must do with exclusive lock)
advance the tail pointer when they invalidate the current tail element.
Then we have the very simple rule that only the startup process ever
changes this data structure.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: global temporary tables
Next
From: Hiroshi Inoue
Date:
Subject: Re: [GENERAL] trouble with to_char('L')