Removing unneeded downlink field from nbtree stack struct

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Removing unneeded downlink field from nbtree stack struct
Дата
Msg-id CAH2-Wzmx+UbXt2YNOUCZ-a04VdXU=S=OHuAuD7Z8uQq-PXTYUg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Removing unneeded downlink field from nbtree stack struct  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Список pgsql-hackers
Attached patch slightly simplifies _bt_getstackbuf() by making it
accept a child BlockNumber argument, rather than requiring that
callers store the child block number in the parent stack item's
bts_btentry field. We can remove the bts_btentry field from the
BTStackData struct, because we know where we ended up when we split a
page and need to relocate parent to insert new downlink -- it's only
truly necessary to remember what pivot tuple/downlink we followed to
arrive at the page being split. There is no point in remembering the
child block number during our initial descent of a B-Tree, since it's
never actually used at a later point, and can go stale immediately
after the buffer lock on parent is released. Besides,
_bt_getstackbuf() callers can even redefine the definition of child to
be child's right sibling after the descent is over. For example, this
happens when we move right, or when we step right during unique index
insertion.

This slightly simplifies the code. Our stack is inherently
approximate, because we might have to move right for a number of
reasons.

I'll add the patch to the 2019-09 CF.
-- 
Peter Geoghegan

Вложения

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

Предыдущее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: Patch to document base64 encoding
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: refactoring - share str2*int64 functions