SnapshotResetXmin

Started by Simon Riggsalmost 17 years ago4 messages
#1Simon Riggs
simon@2ndQuadrant.com

SnapshotResetXmin is called 3 times after each statement in
ReadCommitted mode.

Too keen, perhaps?

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

#2Alvaro Herrera
alvherre@commandprompt.com
In reply to: Simon Riggs (#1)
Re: SnapshotResetXmin

Simon Riggs wrote:

SnapshotResetXmin is called 3 times after each statement in
ReadCommitted mode.

Too keen, perhaps?

It is called each time a snapshot is unregistered and each time an
active snapshot is popped. I don't see any way to reduce the number of
calls without complicating the code a lot ... do you have any ideas?

Maybe we could check whether TransState is not TRANS_INPROGRESS and skip
it in those cases ...?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#2)
Re: SnapshotResetXmin

Alvaro Herrera <alvherre@commandprompt.com> writes:

Simon Riggs wrote:

SnapshotResetXmin is called 3 times after each statement in
ReadCommitted mode.

Maybe we could check whether TransState is not TRANS_INPROGRESS and skip
it in those cases ...?

Surely this would take longer than the function itself does. What's
the point of worrying at all?

regards, tom lane

#4Simon Riggs
simon@2ndQuadrant.com
In reply to: Tom Lane (#3)
Re: SnapshotResetXmin

On Fri, 2009-01-16 at 12:13 -0500, Tom Lane wrote:

Alvaro Herrera <alvherre@commandprompt.com> writes:

Simon Riggs wrote:

SnapshotResetXmin is called 3 times after each statement in
ReadCommitted mode.

Maybe we could check whether TransState is not TRANS_INPROGRESS and skip
it in those cases ...?

Surely this would take longer than the function itself does. What's
the point of worrying at all?

I thought it *might* be indicative of over zealous coding, thats all.

Better a false-positive than to miss a possible issue.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support