NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Database Cracking

Stratos Idreos, Martin L. Kersten, Stefan ManegoldCidr 2007

Abstract

Traditional database performance relies on static indexing structures like B-trees, which require significant upfront creation costs and manual tuning by database administrators (DBAs). This paper introduces "Database Cracking," a paradigm shift where the database physically reorganizes data on-the-fly as a byproduct of query processing. By treating each query as a hint for data partitioning, the system incrementally builds a self-organizing index that adapts to actual workloads without manual intervention.

Introduction

In modern data environments, workloads are often unpredictable, ad-hoc, or subject to frequent shifts. Traditional indexing strategies struggle in these scenarios due to three primary limitations: the high upfront cost of index creation on massive datasets, the maintenance overhead during data updates, and "workload blindness," where pre-built indices may not match actual query patterns.

Database cracking addresses these challenges by adopting a "pay-as-you-go" model. Instead of building a complete index before any queries are run, the system reorganizes the physical storage of a column incrementally. This results in a system that "learns" the workload over time, becoming faster as more queries target specific data ranges.

Methodology: The Cracking Mechanism

The core innovation of database cracking is the transformation of the SELECT operator from a passive data retriever into an active data reorganizer.

The Cracker Column and Index

When a column is first queried, the system creates a "cracker column"—a physical copy of the original data. As subsequent range queries arrive, the system applies partitioning algorithms, such as CrackInTwo or CrackInThree, to physically move tuples into contiguous blocks that match the query predicates. To manage these partitions, a lightweight AVL-tree, known as the "cracker index," tracks the boundaries (or "cracks") discovered by previous queries.

Figure 1: The physical reorganization process. Query Q1 triggers an initial copy and partition, while Q2 further refines the pieces in-place based on new range boundaries.

Integration and Optimization

The researchers implemented this architecture within MonetDB, a column-oriented database. They introduced specialized operators like crackers.select for the cracking process and crackers.rel_select to optimize joins. These operators ensure that the system can handle the destruction of the original "insertion order" while maintaining high performance across multi-column queries.

Experimental Evaluation

The authors evaluated database cracking using synthetic micro-benchmarks (10 million tuples of random integers) and the industry-standard TPC-H benchmark (Query 6). Performance was compared against standard MonetDB, PostgreSQL, and MySQL, both with and without traditional B-tree indices.

Key Results and Insights

  • The Learning Curve: The initial query on a cracked column incurs a performance penalty (approximately 30% slower than a full scan) due to the first reorganization. However, performance improves rapidly with subsequent queries. After roughly 100,000 random queries, the performance of a cracked column converges with that of a fully pre-sorted column.
  • Competitive Performance: In TPC-H tests, MonetDB with cracking quickly outperformed standard installations of PostgreSQL and MySQL. While a manually tuned B-tree index can eventually match the speed of cracking, the cracking approach reaches this performance level automatically, without prior knowledge of the workload.
Figure 6: Performance comparison across different database systems. MonetDB with cracking (bottom grey line) shows a clear "learning curve" where response times drop significantly as the query sequence progresses, eventually outperforming traditional RDBMS even with B-trees.
  • Dynamic Adaptability: Unlike static indices, the cracker index is highly fluid. If the focus of the workload shifts to a different range of values, the system naturally begins "cracking" that new range, refining the data distribution where it is most needed.

Conclusion and Future Directions

Database cracking represents a mature architecture for self-adaptive databases. It successfully eliminates the need for upfront indexing costs and manual tuning, making it ideal for dynamic, ad-hoc environments.

Future research directions include addressing concurrency control—specifically how to manage physical data movement while other queries are active—and improving the handling of data updates. Additionally, extending cracking logic to more complex operations like JOIN and AGGREGATE, and exploring "out-of-memory" cracking for disk-based datasets, remain key areas for development.

Summary updated

BibTeX
@inproceedings{idreos2007database,
  author = {Stratos Idreos and Martin L. Kersten and Stefan Manegold},
  title = {{Database Cracking}},
  booktitle = {Cidr},
  year = {2007},
}
Figure