eng
Schloss Dagstuhl – Leibniz-Zentrum für Informatik
Leibniz International Proceedings in Informatics
1868-8969
2019-11-28
35:1
35:16
10.4230/LIPIcs.ISAAC.2019.35
article
On Optimal Balance in B-Trees: What Does It Cost to Stay in Perfect Shape?
Fagerberg, Rolf
1
Hammer, David
2
1
Meyer, Ulrich
2
University of Southern Denmark, Odense, Denmark
Goethe University Frankfurt, Germany
Any B-tree has height at least ceil[log_B(n)]. Static B-trees achieving this height are easy to build. In the dynamic case, however, standard B-tree rebalancing algorithms only maintain a height within a constant factor of this optimum. We investigate exactly how close to ceil[log_B(n)] the height of dynamic B-trees can be maintained as a function of the rebalancing cost. In this paper, we prove a lower bound on the cost of maintaining optimal height ceil[log_B(n)], which shows that this cost must increase from Omega(1/B) to Omega(n/B) rebalancing per update as n grows from one power of B to the next. We also provide an almost matching upper bound, demonstrating this lower bound to be essentially tight. We then give a variant upper bound which can maintain near-optimal height at low cost. As two special cases, we can maintain optimal height for all but a vanishing fraction of values of n using Theta(log_B(n)) amortized rebalancing cost per update and we can maintain a height of optimal plus one using O(1/B) amortized rebalancing cost per update. More generally, for any rebalancing budget, we can maintain (as n grows from one power of B to the next) optimal height essentially up to the point where the lower bound requires the budget to be exceeded, after which optimal height plus one is maintained. Finally, we prove that this balancing scheme gives B-trees with very good storage utilization.
https://drops.dagstuhl.de/storage/00lipics/lipics-vol149-isaac2019/LIPIcs.ISAAC.2019.35/LIPIcs.ISAAC.2019.35.pdf
B-trees
Data structures
Lower bounds
Complexity