Cianplan

Level 2: Data · L2.1 Data models, SQL vs NoSQL, storage engines & indexing

How indexes work (B-trees)

Explain B-tree lookups, composite and covering indexes.

13 min · Pro

What you take away

  • A B-tree has a fan-out of hundreds, so 100 million rows are three or four page reads deep — and the upper levels are always cached.

And 3 more inside the class, in Pro.

How the class is laid out

  1. The problem
  2. The simple version
  3. Descending the tree
  4. Three rules that follow
  5. Check your understanding