Search Postgresql Archives

Re: pageinspect bt_page_items doc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Jul 24, 2023 at 08:57:05AM +0800, jian he wrote:
> hi.
>
> https://www.postgresql.org/docs/current/pageinspect.html#id-1.11.7.34.6
>
> > This is a B-tree leaf page. All tuples that point to the table happen to be posting list tuples (all of which store a total of 100 6 byte TIDs).
> > There is also a “high key” tuple at itemoffset number 1. ctid is used to store encoded information about each tuple in this example, though
> > leaf page tuples often store a heap TID directly in the ctid field instead. tids is the list of TIDs stored as a posting list.
>
> (all of which store a total of 100 6 byte TIDs)
> I think the meaning is something like:
> (all of which store a total of 100 TIDs, each TID is 6 byte long.)

Yes that's what it means.

>  What's the meaning of  (16, 8292)?  After looking around. I'm still confused.
> Would it be better to add an explanation about (16, 8292) to the docs?

I'm not sure how easy it would be to document it.  If you want more detail
about "encoded information about each tuple" you need to look at the btree
implementation, in src/include/access/nbtree.h.

For instance, to get the number of items in a posting list, you see the
BTreeTupleGetNPosting() function, which basically returns ctid & 0X0FFF.  And
8292 & 0X0FFF is 100, which is the mentioned number of tids.  If you look
around line 462 of the same file (near the BT_OFFSET_MASK) you will see all the
other usage for the ctid in case of a posting list, like knowing whether the
IndexTuple is a posting list of not.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux