Storage, Execution & Recovery Internals
Pages, Records, and File Layout
Storage engines move fixed-size pages but store changing-size records. A slotted page separates stable logical slots from movable record bytes, so compaction can recover contiguous free space without invalidating every record identifier.
- The page is the core transfer and recovery unit.
- A record identifier names page plus slot.
- Variable-width rows grow from the opposite end.
- Logical free space differs from contiguous free space.
- Oversized values need indirection.
- Allocation metadata avoids scanning every page.
| Mechanism | Preserves | Cost / failure symptom |
|---|---|---|
| Slot directory | Stable intra-page identity | Header overhead; damaged offsets corrupt interpretation |
| Compaction | Reusable contiguous space | CPU/latches and extra dirtying |
| Overflow/external value | Bounded base-page row | Pointer chasing and orphan cleanup |
| Free-space map | Fast insertion target | Stale hints cause retries, not wrong data |
| Checksum/page LSN | Detection/recovery ordering | Write overhead; torn/corrupt page becomes visible |