questions about concurrency control in Postgresql

From: 黄晓骋 <huangxclife(at)gmail(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: questions about concurrency control in Postgresql
Date: 2009-12-08 04:05:45
Message-ID: 000901ca77bb$b9e961b0$2dbc2510$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I think in Postgresql, concurrency control acts like this:

tuple's infomask shows if it is being updated. If it is being updated now,
the latter transaction should reread the tuple and get the newer tuple.
During the progress of getting the newer tuple, it must use transaction
lock, I mean XactLockTableWait(...).

From the above, I think the tuple lock is unnecessary, because it uses
transaction lock.

Besides, tuple lock is unlocked after the tuple is updated but not after the
transaction commits. I mean it's not 2PL.

So, may you tell me why there is tuple lock in Postgresql ? Is the tuple
lock necessary?

Thanks,

--Huang Xiaocheng

--Database & Information System Lab, Nankai University

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2009-12-08 04:09:18 Re: EXPLAIN BUFFERS
Previous Message Daniel Farina 2009-12-08 03:44:54 Re: A sniffer for the buffer