22.2.1.2 Page Header

The Page Header has 14 parts, as follows:

Name

Size

Remarks

PAGE_N_DIR_SLOTS

2

number of directory slots in the Page Directory part; initial value = 2

PAGE_HEAP_TOP

2

record pointer to first record in heap

PAGE_N_HEAP

2

number of heap records; initial value = 2

PAGE_FREE

2

record pointer to first free record

PAGE_GARBAGE

2

"number of bytes in deleted records"

PAGE_LAST_INSERT

2

record pointer to the last inserted record

PAGE_DIRECTION

2

either PAGE_LEFT, PAGE_RIGHT, or PAGE_NO_DIRECTION

PAGE_N_DIRECTION

2

number of consecutive inserts in the same direction, for example, "last 5 were all to the left"

PAGE_N_RECS

2

number of user records

PAGE_MAX_TRX_ID

8

the highest ID of a transaction which might have changed a record on the page (only set for secondary indexes)

PAGE_LEVEL

2

level within the index (0 for a leaf page)

PAGE_INDEX_ID

8

identifier of the index the page belongs to

PAGE_BTR_SEG_LEAF

10

"file segment header for the leaf pages in a B-tree" (this is irrelevant here)

PAGE_BTR_SEG_TOP

10

"file segment header for the non-leaf pages in a B-tree" (this is irrelevant here)

(Note: I'll clarify what a "heap" is when I discuss the User Records part of the page.)

Some of the Page Header parts require further explanation:

  • PAGE_FREE :

Records which have been freed (due to deletion or migration) are in a one-way linked list. The PAGE_FREE pointer in the page header points to the first record in the list. The "next" pointer in the record header (specifically, in the record's Extra Bytes) points to the next record in the list.

  • PAGE_DIRECTION and PAGE_N_DIRECTION:

It's useful to know whether inserts are coming in a constantly ascending sequence. That can affect InnoDB's efficiency.

  • PAGE_HEAP_TOP and PAGE_FREE and PAGE_LAST_INSERT:

Warning: Like all record pointers, these point not to the beginning of the record but to its Origin (see the earlier discussion of Record Structure).

  • PAGE_BTR_SEG_LEAF and PAGE_BTR_SEG_TOP:

These variables contain information (space ID, page number, and byte offset) about index node file segments. InnoDB uses the information for allocating new pages. There are two different variables because InnoDB allocates separately for leaf pages and upper-level pages.


User Comments
Sign Up Login You must be logged in to post a comment.