Study Vault Search notes, aliases and full text
Graph
ConceptDBISProofread

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 dd.
  • Each leaf has up to dd pairs (value, row index)
  • Each leaf is always on the same level
  • The depth is boundded by ⌈log⁡d(n)⌉\lceil\log_d(n)\rceil

Operations#

Lookup#

  • value lookup takes O(log⁡(n))O(\log(n)) time. Proportional to log⁡2(d)\log_2(d)
  • 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!()

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only