HomeAlgorithms & AIB+ Tree Database Index

🗂️ B+ Tree Database Index

Explore how a B+ tree index stores all records in linked leaf nodes, letting databases scan sorted ranges by walking a chain instead of retraversing the tree.

Algorithms & AI3DModerate60 FPS
b-plus-tree-index-lab ↗ Open standalone

This simulation demonstrates how a B+ tree keeps all records in leaf nodes while internal nodes hold only routing keys, and it visualizes the sorted linked list connecting the leaves so you can see how a range scan walks sideways across leaves instead of re-descending the tree for every next record.

🔬 What It Demonstrates

This simulation demonstrates how a B+ tree keeps all records in leaf nodes while internal nodes hold only routing keys, and it visualizes the sorted linked list connecting the leaves so you can see how a range scan walks sideways across leaves instead of re-descending the tree for every next record.

🎮 How to Use

Insert keys one at a time and watch new entries land in leaf nodes, splitting a leaf and pushing a copied separator key upward whenever a leaf overflows. Delete keys to see leaves borrow from siblings or merge, with the leaf chain pointers automatically rewired. Use the range scan control to pick a start and end key and watch the simulation descend once, then step sideways along the leaf chain to collect every matching record.

💡 Did You Know?

Did you know that in a B+ tree, when a leaf splits, the separator key pushed up to the parent is only a copy, the original key stays behind in the leaf with its data, whereas splitting an internal node actually moves the key up and removes it from below, since internal nodes carry no data to protect.

⚙ Under the hood

Explore how a B+ tree index stores all records in linked leaf nodes, letting databases scan sorted ranges by walking a chain instead of retraversing the tree.

databaseb-plus-treeindexingdata-structuresrange-queryinnodbpostgresql

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)