Database internals explorer
See how databases find data fast: a B-tree and a B+ tree index, with node splits and range scans, explained step by step.
- TypeScript
- B-tree
- B+ tree
- Indexes
loading tool…
See how databases find data fast: a B-tree and a B+ tree index, with node splits and range scans, explained step by step.
loading tool…
Think of it as: A phone book. You do not read every page — you jump to the right section, then the right page.
Press Add to put 40 in. The box is already full, so watch what happens. Then try Find.
This is a B-tree, the structure behind most database indexes. Each box (node) holds a few sorted numbers; the numbers between them tell you which box below to open. All the bottom boxes are at the same depth, so every lookup takes the same few steps — O(log n) — even with millions of rows.
When a box would overflow it splits, and its middle key moves up. If the top box splits, the tree grows one level taller. Real databases size each box to one disk page, so a box holds hundreds of keys.