Re: Exposing the Xact commit order to the user

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dan Ports <drkp(at)csail(dot)mit(dot)edu>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org, JanWieck(at)Yahoo(dot)com
Subject: Re: Exposing the Xact commit order to the user
Date: 2010-05-25 11:02:40
Message-ID: 5E04E04F-FC0A-4726-821C-A19F5AD52035@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On May 25, 2010, at 3:21 , Tom Lane wrote:
> Florian Pflug <fgp(at)phlo(dot)org> writes:
>> The subtle point here is whether you consider the view from the "outside" (in the sense of what a read-only transaction started at an arbitrary time can or cannot observe), or from the "inside" (what updating transactions can observe and might base their updates on).
>
>> The former case is completely determined by the commit ordering of the transactions, while the latter is not - otherwise serializability wouldn't be such a hard problem.
>
> BTW, doesn't all this logic fall in a heap as soon as you consider
> read-committed transactions?

Why would it? There's still a well defined point in time at which the transaction's effects become visible, and every other transaction commits either before that time or after that time. An observer started between two transactions sees the first's changes but not the second's. One replace observing read committed transactions by a series of smaller repeatable read transactions, since the observers are read-only anyway.

This of course says nothing about what state the updating transactions themselves see as the current state. For e.g. replication that is adequate, since you'd not replay the original commands but rather the effects they had in terms of physical tuple updates. On replay, the effects of a transaction to therefor not depend on the state the transaction sees.

best regards,
Florian Pflug

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Goncharov 2010-05-25 11:35:34 Re: libpq, PQexecPrepared, data size sent to FE vs. FETCH_COUNT
Previous Message Robert Haas 2010-05-25 10:57:12 Re: JSON manipulation functions