Data Structure Simulators

B+Tree Visualizer

The B+tree is what almost every relational database actually uses. The internal nodes are a pure directory — no data — and all the rows live in the leaves, which are linked left to right. So a range scan is one clean sweep.

How a B+tree works

A B+tree splits the job in two. The internal nodes hold only keys, acting as a directory that routes you downward; all the row data lives in the leaf nodes. The leaves are then chained together like a linked list in sorted order. So a point lookup always walks the full height to a leaf, and — the payoff — a range scan lands in the first leaf and then just follows the leaf links along, in order, without ever climbing back up.

Why it beats a plain B-tree for ranges

For the full write-up, see MySQL Internals.