On Mon, Mar 9, 2015 at 4:06 PM, Peter Geoghegan <p...@heroku.com> wrote:

> On Mon, Mar 9, 2015 at 3:51 PM, Jeff Janes <jeff.ja...@gmail.com> wrote:
> > How do I know if I am looking at a non-rightmost page?
>
> 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.



> It will (as the
> docpatch points out) also necessarily have a ""high key" item.  We
> know that we have to move right if the high key doesn't bound the
> value we expected to find on the page (our scankey item - what the
> index scan is searching for). So the high key goes with having a
> rightlink, and in general we detect that we're looking at a
> non-rightmost page based on the presence of a right-link.
>

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.

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.

Thanks,

Jeff

Reply via email to