+--------+------------+---------------------------+ | Header | Free space | Nodes | +--------+------------+---------------------------+
Header: A data page has the following metadata:
Size Description 4 Number of this page 4 Page number of preceding page 4 Page number of following page 3 Doc id of this page 1 Key type of this page 4 Reserved 4 bytes 4 Flags: 0x01 - BTree internal page 0x02 - BTree leaf page 0x04 - Overflow page 0x08 - Recno internal page 0x10 - Recno leaf page 0x20 - Never delete this chain of pages 2 node number on this page 2 Upper bound of free space on page
Page number of preceding page: For overflow page, it is used to store original page number. The parent page number of root page is 0.
Page number of following page: For overflow pages, it is used to store next overflow page number.
Nodes: Each node has a key and a data item. Ordinarily, the key and/or data immediately follow the flags. If the key or data is too big, it's stored on a separate 'overflow' page (or pageS, if it's really big!). In that case, the node contains a 4-byte of the first overflow page number
Overflow pages have the same header as normal pages, but simply hold raw key/data bytes. They use the 'next page' value to chain successive pages of data together.
Each node has the following format:
Size Description 4 Key Size 4 Data Size 1 Flags: 0x01 for overflow data, 0x02 for overflow key 2 size of space allocated for this node within the page n Key/Data (4 bytes overflow page number in case key/data overflow)
|
|
|
|
|
|