Module 1 · Storage
Episode 4 Slotted Pages
▶ This video is coming to YouTube soon.
Inside one 8 KB Postgres page: the line pointer array growing forward, rows growing backward, pd_lower and pd_upper, the hole a DELETE leaves and the compaction that closes it. A page simulation predicts every offset, and pageinspect confirms each one.
Chapters
- 0:00Intro
- 0:16Rows moved, addresses didn't
- 0:36Why not point at byte offsets?
- 1:15Slots grow forward, rows grow back
- 2:16One line pointer: 4 bytes
- 2:46A hole, then compaction
- 3:48Free slots are reused
- 4:30The code: add a row to a page
- 5:01The code: compaction
- 5:31Proof: one page in pageinspect
- 6:41Where Postgres differs from the textbook
- 7:11Recap
- 7:39Next: Tuple Layout