Introduction
Traditional database systems treat every query as an isolated event. Once a result is delivered, the computational effort expended is discarded. This is particularly inefficient in Approximate Query Processing (AQP), where systems use data samples to provide fast, "good enough" answers. The authors of Verdict propose a new paradigm: Database Learning (DBL). DBL enables database systems to "learn" from the results of past queries, building a probabilistic model of the underlying data distribution to accelerate future queries and reduce error.
System Architecture and Methodology
Verdict implements the Database Learning vision by integrating a learning component into the standard query processing pipeline. Unlike traditional systems, Verdict treats query answers as random variables that reveal information about the underlying data distribution.
The system relies on several key technical innovations:
- Query Snippets: Complex SQL queries are decomposed into atomic "snippets" that return single scalar values, allowing query answers to be treated as random variables in a statistical model.
- Principle of Maximum Entropy (ME): Verdict uses the ME principle to identify the most likely joint probability distribution that fits all previously observed query answers without making unfounded assumptions.
- Inter-tuple Covariance: By modeling correlations between data points using squared exponential covariance functions, the system can extrapolate knowledge to unqueried regions of the database.
- Hybrid Inference: At runtime, Verdict combines a "raw" answer from a standard AQP engine with its learned model. This "improved answer" is mathematically guaranteed to have an expected error no larger than the original sample-based answer.
The Learning Process
The core intuition behind Database Learning is that every query reveals information about the underlying data. If queries overlap or touch related data, their answers are correlated. As the system observes more queries, its internal model becomes increasingly refined, narrowing the confidence intervals for predicted values.
This process allows the model to eventually act as a concise proxy for the database. In the ideal case, a perfect statistical model of a few kilobytes could replace terabytes of raw data for analytical tasks. Because the inference step is a simple matrix-vector multiplication, the overhead is negligible (typically under 10ms), while the storage requirements are independent of the total dataset size.
Evaluation and Key Results
Verdict was evaluated using industry-standard benchmarks (TPC-H) and massive real-world datasets, including a 536 GB analytical trace from a major DBMS vendor. Key findings include:
- Significant Speedups: Verdict achieved up to 23.0x speedup for the same accuracy level compared to non-learning AQP systems.
- Drastic Error Reduction: For a fixed time budget, the system reduced approximation errors by 75.8% to 90.2%.
- Broad Applicability: The system successfully supported over 73% of analytical queries in real-world traces.
- Robustness: Performance gains remained consistent across various data distributions, including Uniform, Gaussian, and Skewed.
Limitations and Future Directions
While Verdict represents a significant advancement, certain challenges remain. Current limitations include a lack of support for MIN/MAX aggregates, complex disjunctions (OR), and textual filters. Additionally, while the system handles data appends well, frequent deletions or updates to existing rows require further research. Future work may involve "Active Database Learning," where the system proactively runs background queries to fill knowledge gaps and optimize the model before user requests arrive.
Summary updated