Re: Reuse the dead item on unique index.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Reuse the dead item on unique index.
Дата
Msg-id 11730.1128743941@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Reuse the dead item on unique index.  (Atsushi Ogawa <atsushi.ogawa@gmail.com>)
Ответы Re: Reuse the dead item on unique index.  (Atsushi Ogawa <atsushi.ogawa@gmail.com>)
Список pgsql-hackers
Atsushi Ogawa <atsushi.ogawa@gmail.com> writes:
> When _bt_check_unique finds a dead item that has same data as new
> item, LP_DEAD is set to the item. Can we reuse this dead item instead
> of inserting new item?

This strikes me as a pretty bad idea for the same reason pointed out
recently in other threads: the notion of equality embodied in a btree
opclass' equals function may have little or nothing to do with true
identity.  So your assumption that it's the "same" data is faulty.

Also, I'm dubious about the assumption that "can be marked LP_DELETED"
is the same as "can be physically removed right now".  The side-effects
on indexscans happening concurrently with yours could be bad.  At the
very least you'd need to obtain super-exclusive lock (cf btbulkdelete)
before doing the replacement.
        regards, tom lane


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

Предыдущее
От: Atsushi Ogawa
Дата:
Сообщение: Reuse the dead item on unique index.
Следующее
От: sandeep satpal
Дата:
Сообщение: Re: Issue is changing _bt_compare function and