Re: How is statement level read consistency implemented?

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How is statement level read consistency implemented?
Date: 2008-04-22 11:11:01
Message-ID: fukh46$j73$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pavan Deolasee, 22.04.2008 12:57:
> On Tue, Apr 22, 2008 at 4:11 PM, Thomas Kellerer <spam_eater(at)gmx(dot)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

The xmin, xmax info is basically what I was looking for.

As far as I can tell (from the PDF and your quote) Postgres uses a very similar concept as Oracle. .
Each transaction has a uniqe number and each tuple contains the information for which transaction number it is visible.

Thanks for the quick answer.
Thomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kerri Reno 2008-04-22 12:44:14 Re: Schema migration tools?
Previous Message Martijn van Oosterhout 2008-04-22 11:07:30 Re: How is statement level read consistency implemented?