B+ Tree
Also Index B+ Tree · B+-Tree
An index B+ tree of degree d is a balanced search tree over the (value, row index) pairs of a column, with all pairs in sorted, linked leaves on one level, giving lookups in O(log n) time and sorted scans for joins.
A index B+ tree is a search tree.
- Each inner node has maximum degree .
- Each leaf has up to pairs (value, row index)
- Each leaf is always on the same level
- The depth is boundded by
Operations#
Lookup#
- value lookup takes time. Proportional to
- For joining, SQLite3 uses B+ trees as follows:
- Iterator over one join column
- lookup the values in the B+ tree of the other join column
- If a there is a B+ tree for both join columns:
- perfoming Merge Join is very efficient (SQLite3 does not do this)
Updates#
todo!()