Re: determine snapshot after obtaining locks for first statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: determine snapshot after obtaining locks for first statement
Date: 2009-12-16 22:52:03
Message-ID: 18042.1261003923@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-12-16 22:57:21 Re: Does "verbose" Need to be Reserved?
Previous Message Robert Haas 2009-12-16 22:45:57 Re: PATCH: Add hstore_to_json()