B-trees are the standard index structure in relational databases. They keep data sorted and allow searches, insertions, and deletions in time.
Structure:
- Balanced tree with high branching factor (~- children per node)
- Leaf nodes contain pointers to actual rows
- Internal nodes guide the search
Efficient for:
- Equality lookups:
WHERE id = 5 - Range queries:
WHERE date > '2024-01-01' - Sorting:
ORDER BY name