Re: mvcc & DML on the same row

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: mvcc & DML on the same row
Дата
Msg-id 1292508661.1193.3161.camel@ebony
обсуждение исходный текст
Ответ на mvcc & DML on the same row  (matteo durighetto <desmodemone@gmail.com>)
Ответы Re: mvcc & DML on the same row  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Wed, 2010-12-15 at 20:50 +0100, matteo durighetto wrote:
> if  we continue the transaction and we do for example another update
> on this row (X) , we again redo the same operation:
> 
>    X0  (deleted "old" row)
>    X1  (row inserted, NOW deleted) => not needed for rollback
>    X2  (insert "new" row  )

This situation has a simple user-space solution: only make one update to
a row, rather than two.

> But why we need all these versions of the same row on table, if for
> rollback we need only the original row X (X0) ?

X1 cannot be removed because X0 points to it, via its t_ctid field.

In order to remove X1 we would need to change X0 to point to X2, which
we don't do because we're not allowed to update in place. Even if we
could, I'm not sure this case is frequent enough to be worth the effort.

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: SQL/MED - file_fdw
Следующее
От: Nicolas Barbier
Дата:
Сообщение: Re: Extensions, patch v18 (merge against master, bitrot-only-fixes)