Re: Reducing some DDL Locks to ShareLock

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Reducing some DDL Locks to ShareLock
Дата
Msg-id 21180.1226525144@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Reducing some DDL Locks to ShareLock  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Reducing some DDL Locks to ShareLock  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Reducing some DDL Locks to ShareLock  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> On Tue, 2008-11-11 at 21:57 -0500, Tom Lane wrote: 
>> I was imagining that the heap_inplace_update operation would release the
>> lock.  Is there some problem with the concept?

> Not the concept, just the mechanism.

> Current tuple lock requestors do XactLockTableWait() which waits until
> the lock on the transaction is released and removed from procarray.

Ah, I see.  Yeah, that won't work nicely.

> The only way I can see to do this is by having another lock type, using
> an additional info bit on t_infomask2.

The alternative I was thinking about involved taking an exclusive buffer
lock on the page containing the tuple to be updated in-place.  The point
being that you have to examine the old tuple contents and decide whether
to update after you have lock, not before.  I think this would amount to
refactoring heap_inplace_update into two operations: fetch/lock and
update/unlock.  (I guess there should be a third function to release
without updating, too --- that would really just be an unlock-buffer
operation, but it'd be better if callers didn't explicitly know that.)
The callers would probably still use the syscache to obtain the tuple
address, but they wouldn't rely on it to supply the tuple image.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Block-level CRC checks