Re: determine snapshot after obtaining locks for first statement - Mailing list pgsql-hackers

From Tom Lane
Subject Re: determine snapshot after obtaining locks for first statement
Date
Msg-id 18042.1261003923@sss.pgh.pa.us
Whole thread Raw
In response to determine snapshot after obtaining locks for first statement  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: determine snapshot after obtaining locks for first statement  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> The Cahill thesis mentions an interesting optimization -- they defer
> determination of the snapshot until after any locks required for the
> first statement have been acquired.  Where the first statement was,
> for example, an UPDATE, this reduced re-reads or rollbacks in the
> face of concurrent modifications.
> Does PostgreSQL currently do this?

Yes --- it's not an "optimization", it's necessary for basic
functionality to work correctly.  See for example the last para at
http://www.postgresql.org/docs/8.4/static/applevel-consistency.html
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: PATCH: Add hstore_to_json()
Next
From: "David E. Wheeler"
Date:
Subject: Re: Does "verbose" Need to be Reserved?