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
обсуждение исходный текст
Ответ на Re: Documentation of bt_page_items()'s ctid field  (Jeff Janes <jeff.janes@gmail.com>)
Ответы Re: Documentation of bt_page_items()'s ctid field  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-hackers
On Mon, Mar 9, 2015 at 5:18 PM, Jeff Janes <jeff.janes@gmail.com> 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
Дата:
Сообщение: Re: Documentation of bt_page_items()'s ctid field
Следующее
От: Andreas Karlsson
Дата:
Сообщение: Re: Using 128-bit integers for sum, avg and statistics aggregates