Re: Documentation of bt_page_items()'s ctid field

Поиск
Список
Период
Сортировка
Искать
От
Peter Geoghegan
Тема
Re: Documentation of bt_page_items()'s ctid field
Дата
Msg-id
CAM3SWZQBqXzvmbvJnx36A6HRx1UnmK_kP+gVEvCgjMvYxEGjmQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Documentation of bt_page_items()'s ctid field Peter Geoghegan <pg@heroku.com>
Re: Documentation of bt_page_items()'s ctid field Heikki Linnakangas <hlinnakangas@vmware.com>
Re: Documentation of bt_page_items()'s ctid field Peter Geoghegan <pg@heroku.com>
Re: Documentation of bt_page_items()'s ctid field Heikki Linnakangas <hlinnakangas@vmware.com>
Re: Documentation of bt_page_items()'s ctid field Peter Geoghegan <pg@heroku.com>
Re: Documentation of bt_page_items()'s ctid field Jeff Janes <jeff.janes@gmail.com>
Re: Documentation of bt_page_items()'s ctid field Peter Geoghegan <pg@heroku.com>
Re: Documentation of bt_page_items()'s ctid field Jeff Janes <jeff.janes@gmail.com>
Re: Documentation of bt_page_items()'s ctid field Peter Geoghegan <pg@heroku.com>
Re: Documentation of bt_page_items()'s ctid field Jeff Janes <jeff.janes@gmail.com>
Re: Documentation of bt_page_items()'s ctid field Tom Lane <tgl@sss.pgh.pa.us>
Re: Documentation of bt_page_items()'s ctid field Peter Geoghegan <pg@heroku.com>
On Mon, Mar 9, 2015 at 5:18 PM, Jeff Janes  wrote:
>> It has a right-link (that's the easiest way to tell).
>
>
> Meaning that btpo_next is not zero?  Should we say that in the patch in so
> many words?  I think it will be hard to explain the page_items more without
> also explaining the page_stats more.

Yes. And my wording above was sloppy: By definition, a non-rightmost
page is a page that has a rightlink (it will also have a highkey, but
that's certainly not how we distinguish them).

Attached patch adds a definition of non-rightmost in parenthesis,
which I think helps.

> So if I understand this correctly, if there is a high key it is itemoffset
> 1, but to know whether itemoffset 1 is a high key I first have to look at
> btpo_next.

Yes. The logic for caring about "minus infinity" items within internal
pages is hardcoded into _bt_compare(), so it's kind of a low-level
detail, even by these standards...but it comes up with pageinspect,
since they consume an IndexTuple. Confusion ensues.

> And if there is a minus infinity, it will either be itemoffset 2 or 1,
> depending on whether there is a high key or not.

That's correct. So "data" can be "(has data), (has no data), (has
data), (has data) .... " on a given page, which could freak users out.

-- 
Peter Geoghegan
В списке pgsql-hackers по дате отправления
От: Jeff Janes
Дата:
От: Andreas Karlsson
Дата:
FAQ