Slotted Pages and Stable Tuple Locations

Store variable-sized records behind slots so compaction changes their byte offsets without changing every reference.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. The slot directory provides an indirection
  2. Free space can be fragmented within one page

The slot directory provides an indirection

A slotted page keeps a directory of offset and length entries. A tuple identifier can name a page and slot. Inserting a row allocates record bytes and a slot, while deletion may leave a free gap. Compacting records moves bytes and updates their slots. References using the stable slot number still address the same logical tuple, subject to the engine’s reuse rules.

Free space can be fragmented within one page

A page with two small holes might have enough total free bytes for a record without a large enough contiguous area. Compaction can bring free space together. Reusing a slot while some references still identify its older contents needs version or lifecycle safeguards. Buffer pools manage residency of these pages. Secondary indexes illustrate why the meaning of a tuple location matters outside the page.[1][2]

References

  1. CMU 15-445/645, Introduction to Database Systems: Lectures ↩
  2. PostgreSQL Global Development Group, PostgreSQL Documentation ↩