pub struct Header {
pub lsn: Option<XLogRecPtr>,
pub checksum: u16,
pub flags: PageFlags,
pub lower: LocationIndex,
pub upper: LocationIndex,
pub special: LocationIndex,
pub pagesize_version: u16,
pub prune_xid: Option<TransactionId>,
}Fields§
§lsn: Option<XLogRecPtr>Log Sequence Number: Position in the WAL just past the last record that changed the page,
or None (stored as 0) if no record has, as on a page fresh from Page::init.
See WAL Internals.
checksum: u16§flags: PageFlags§lower: LocationIndexOffset of the start of free space, just past the last line pointer.
upper: LocationIndexOffset of the end of free space, where tuple data begins.
special: LocationIndexOffset of the start of the special space, which the access method reserves. See Database Page Layout.
pagesize_version: u16Page size in the high bits, layout version in the low byte.
prune_xid: Option<TransactionId>Oldest transaction whose deletions on this page could be pruned, or None (stored as 0)
if there are none. Postgres only treats it as a hint, and leaves it unused on index pages.
See Heap-Only Tuples (HOT),
and chapter 5, “Page Pruning and HOT Updates”, of PostgreSQL 14 Internals by Egor Rogov.
Implementations§
Source§impl Header
impl Header
Sourcepub fn try_from_raw(raw: &[u8; 24]) -> Result<Self, InvalidHeader>
pub fn try_from_raw(raw: &[u8; 24]) -> Result<Self, InvalidHeader>
Parses a header, with the checks Postgres runs before letting a page into the buffer pool. They don’t prove the header right, only plausible.