A deep dive into how SQL databases work internally, covering the fundamental data structures that power them. Explains how rows are stored on disk with fixed and variable-length values, how the heap organizes rows into pages for efficient I/O, and why B-trees are used for indexes instead of hash tables. Covers the trade-offs between arrays, hash tables, and relations, and explains why full table scans are slow and how indexes enable logarithmic search performance.

10m read timeFrom calpaterson.com
Post cover image
Table of contents
The relationThe rowThe heapThe indexThe combination in practiceContact/etcFurther reading

Sort: