Re: Tuple visibility within a single XID

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: Tuple visibility within a single XID
Дата
Msg-id CAJjS0u3_WG0JENwQ6MNFGXsWSj=fnPtma9ry_qmzZhorw1t-kw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Tuple visibility within a single XID  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Tuple visibility within a single XID  (Peter Geoghegan <pg@heroku.com>)
Re: Tuple visibility within a single XID  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Apr 7, 2015 at 6:11 PM, Peter Geoghegan <pg@heroku.com> wrote:
> No. For one thing, unique index enforcement still requires the tuples
> to be treated as a conflict while the other transaction is running
> IMV.
>

Not sure if I understand correctly: in uniqueness check, we see all
possible tuples with a dirty snapshot.  For a tuple version inserted
and updated by myself, it is surely dead no matter how the transaction
ends. So I interpret that we can safely pruning the version.

Early pruning may cause some behavior change though. For example, here is a T1:

begin;  -- loop the following statements many times  insert into pk values (1);  -- uniqueness defined  delete from
pk;
abort;

If another transaction T2 coming later than T1, and if we prune early,
then T1 can suddenly hang on insertion waiting for T2 to complete. But
does this violate any isolation rule?
Thanks,
Qingqing



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_regress writes into source tree
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: pg_rewind and log messages