Re: SSI heap_insert and page-level predicate locks

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: SSI heap_insert and page-level predicate locks
Дата
Msg-id 4DEFB169020000250003E3BD@gw.wicourts.gov
обсуждение исходный текст
Ответ на SSI heap_insert and page-level predicate locks  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: SSI heap_insert and page-level predicate locks  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
> heap_insert() calls CheckForSerializableConflictIn(), which checks if

> there is a predicate lock on the whole relation, or on the page we're

> inserting to. It does not check for tuple-level locks, because there

> can't be any locks on a tuple that didn't exist before.
>
> AFAICS, the check for page lock is actually unnecessary. A page-level

> lock on a heap only occurs when tuple-level locks are promoted. It is

> just a coarser-grain representation of holding locks on all tuples on

> the page, *that exist already*. It is not a "gap" lock like the index

> locks are, it doesn't need to conflict with inserting new tuples on
the
> page. In fact, if heap_insert chose to insert the tuple on some other

> heap page, there would have been no conflict.

Absolutely correct.  Patch attached.

-Kevin


Вложения

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

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: gcc 4.6 and hot standby
Следующее
От: Brar Piening
Дата:
Сообщение: Re: smallserial / serial2