Index

Module 05 · From ScratchDatabase

Database 04: The B-Tree

The B-Tree
The B-Tree · Open board

Follows Pages, and hands off to Write-Ahead Log.

Before you start. This series builds a small database: a program that stores rows on disk and finds them again by key. So far it can split a file into fixed-size 4 KB blocks called pages, and give every row an address made of a page number plus a slot inside that page. It can also find one row instantly by key, using a table built for single lookups - but that table cannot answer “every row between these two keys,” only one key at a time, because the trick that makes it fast also scrambles the order of the keys. What’s missing is a catalog that keeps its entries in order and is still built out of those same fixed-size pages. That catalog is what this lesson builds.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Review From Scratch →

Saved in this browser, and to your account when you sign in.