The Fil Header has eight parts, as follows:
Name |
Size |
Remarks |
|
4 |
4 ID of the space the page is in |
|
4 |
ordinal page number from start of space |
|
4 |
offset of previous page in key order |
|
4 |
offset of next page in key order |
|
8 |
log serial number of page's latest log record |
|
2 |
current defined types are:
|
|
8 |
"the file has been flushed to disk at least up to this lsn" (log serial number), valid only on the first page of the file |
|
4 |
the latest archived log file number at the time that
|
FIL_PAGE_SPACEis a necessary identifier because different pages might belong to different (table) spaces within the same file. The word "space" is generic jargon for either "log" or "tablespace".FIL_PAGE_PREVandFIL_PAGE_NEXTare the page's "backward" and "forward" pointers. To show what they're about, I'll draw a two-level B-tree.
--------
- root -
--------
|
----------------------
| |
| |
-------- --------
- leaf - <--> - leaf -
-------- --------
Everyone has seen a B-tree and knows that the entries in the
root page point to the leaf pages. (I indicate those pointers
with vertical '|' bars in the drawing.) But sometimes people
miss the detail that leaf pages can also point to each other
(I indicate those pointers with a horizontal two-way pointer
'<-->' in the drawing). This feature allows
InnoDB to navigate from leaf to leaf
without having to back up to the root level. This is a
sophistication which you won't find in the classic B-tree,
which is why InnoDB should perhaps be
called a B+-tree instead.
The fields
FIL_PAGE_FILE_FLUSH_LSN,FIL_PAGE_PREV, andFIL_PAGE_NEXTall have to do with logs, so I'll refer you to my article “How Logs Work With MySQL And InnoDB” ondevarticles.com.FIL_PAGE_FILE_FLUSH_LSNandFIL_PAGE_ARCH_LOG_NOare valid only for the first page of a data file.