Cracking in-memory database index: A case study for Adaptive Radix Tree index

Gang Wu, Yidong Song, Guodong Zhao, Wei Sun, Donghong Han, Baiyou Qiao, Guoren Wang, Ye Yuan

Introduction

In-memory databases (IMDBs) are designed for extreme performance, relying heavily on sophisticated indexing structures like the Adaptive Radix Tree (ART). However, these structures present a significant challenge: building a complete index upfront is computationally expensive and creates a massive initialization bottleneck. This delay can render a database temporarily unavailable and is often wasteful if the actual workload only targets a subset of the data.

This paper explores the application of "database cracking"—a paradigm where indexes are built and refined incrementally based on incoming queries—to the ART. By merging the zero-upfront cost of cracking with the high performance of a radix tree, the authors propose a system that adapts dynamically to workloads while reducing initial setup time by 75%.

Methodology: ART Index Cracking

The core contribution is the ART Index Cracking algorithm. Unlike traditional cracking designed for simple columnar arrays, this approach manages a complex tree structure using three auxiliary components:

  1. Cracker Column: A physical copy of the indexed database column.
  2. Range Lookup Table: A metadata tracker that records which data "slices" (ranges) have been sorted and integrated into the index.
  3. ART Index: The actual tree structure, which begins as an empty root and grows as queries arrive.
The ART Cracking process: As queries (Q1-Q3) arrive, the Cracker Column is partitioned, the Lookup Table is updated, and the ART index is incrementally built.

When a range query is received, the system consults the Lookup Table. If the requested range is not yet indexed, the algorithm physically groups that data within the Cracker Column. After returning the query result, the sorted slice is inserted into the ART. To maintain performance during data updates (inserts/deletes), the authors utilize Caching to delay updates and Shuffling to maintain sorted order within the Cracker Column without expensive global data shifts.

Key Insights and Experimental Evaluation

The researchers evaluated the algorithm using synthetic datasets (10 million integers) and the YCSB benchmark. A critical discovery was the impact of data ordering on index construction. Inserting disordered data into an ART is significantly slower (up to 2x) than ordered data due to increased CPU cache misses. Cracking naturally mitigates this by sorting data into cache-friendly "slices" before insertion.

Initialization time comparison: Disordered data significantly increases the time required to build the index compared to ordered or even-order data.

Furthermore, the speed of index convergence depends on query selectivity. Broad queries (high selectivity) are slower to execute initially but build the index faster, while highly specific queries are fast but leave the index incomplete for longer. This trade-off ensures that the system only performs heavy indexing work when the workload demands it.

Results and Conclusion

The ART cracking approach demonstrates several key advantages:

  • Initialization Speedup: Average index initialization time is reduced by 75% compared to a full upfront ART build.
  • Performance Convergence: While initial queries are slightly slower than those on a fully built ART, response times quickly converge to match standard ART performance as the index matures.
  • Update Efficiency: The "Shuffling" technique allows the system to remain competitive even in write-heavy environments.

While the approach is sensitive to extreme fluctuations in access patterns, it provides a robust solution for modern IMDBs. Future work will focus on developing a concurrent version of ART cracking to support multi-threaded environments.

Summary updated

BibTeX
@inproceedings{wu2019cracking,
  author = {Gang Wu and Yidong Song and Guodong Zhao and Wei Sun and Donghong Han and Baiyou Qiao and Guoren Wang and Ye Yuan},
  title = {{Cracking in-memory database index: A case study for Adaptive Radix Tree index}},
  booktitle = {Inf. Syst},
  year = {2019},
  doi = {10.1016/j.is.2021.101913},
}
Figure