Re: How is statement level read consistency implemented?

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: How is statement level read consistency implemented?
Дата
Msg-id 2e78013d0804220357j53f5bf98w8cb23ef14434fc1b@mail.gmail.com
обсуждение исходный текст
Ответ на How is statement level read consistency implemented?  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: How is statement level read consistency implemented?
Список pgsql-general
On Tue, Apr 22, 2008 at 4:11 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
>
>
>  I am interested in the technical details on how PG determines that a block
> needs to be read from from "some other place than the data block" because
> another transaction has updated the data block.
>

Postgres uses MVCC for transaction consistency. When a row is updated,
a new copy of the row is created and the old version is marked for
deletion (though its not removed immediately). The old readers
continue to read from the old copy whereas new transactions see the
new copy. This is all managed by XMIN and XMAX which are transaction
ids of the inserting and deleting transactions respectively and
control the visibility of the different versions.

If you want to understand MVCC, please see this excellent
documentation by Tom Lane:
http://www.postgresql.org/files/developer/transactions.pdf

Thanks,
Pavan


--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: How is statement level read consistency implemented?
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: How is statement level read consistency implemented?