[Paper Review] DeepDB: Learn from Data, not from Queries!
DeepDB proposes a data-driven approach to learned database management systems, training deep probabilistic models (Relational Sum-Product Networks) directly on database data rather than on query workloads. This enables accurate, generalizable query processing, cardinality estimation, and machine learning tasks without retraining after data updates, outperforming workload-driven baselines by orders of magnitude in accuracy and efficiency.
The typical approach for learned DBMS components is to capture the behavior by running a representative set of queries and use the observations to train a machine learning model. This workload-driven approach, however, has two major downsides. First, collecting the training data can be very expensive, since all queries need to be executed on potentially large databases. Second, training data has to be recollected when the workload and the data changes. To overcome these limitations, we take a different route: we propose to learn a pure data-driven model that can be used for different tasks such as query answering or cardinality estimation. This data-driven model also supports ad-hoc queries and updates of the data without the need of full retraining when the workload or data changes. Indeed, one may now expect that this comes at a price of lower accuracy since workload-driven models can make use of more information. However, this is not the case. The results of our empirical evaluation demonstrate that our data-driven approach not only provides better accuracy than state-of-the-art learned components but also generalizes better to unseen queries.
Motivation & Objective
- To address the high cost and brittleness of workload-driven training in learned DBMS components, which require expensive query execution and frequent retraining.
- To develop a data-driven alternative that captures joint data distributions and supports multiple tasks without workload-specific training.
- To enable ad-hoc query processing and dynamic data updates without model retraining.
- To evaluate whether data-driven models can outperform workload-driven models in accuracy and generalization.
- To demonstrate that a single learned model can support query answering, cardinality estimation, and machine learning tasks simultaneously.
Proposed method
- Proposes Relational Sum-Product Networks (RSPNs) as deep probabilistic models that capture joint data distributions, including attribute correlations and marginal distributions.
- Employs a probabilistic query compilation technique to translate SQL-like queries into expectations and probabilities over RSPNs for efficient inference.
- Trains the RSPN model once on the full database data, avoiding per-query or per-workload training.
- Supports direct updates (inserts, deletes, updates) by incrementally adjusting the model without full retraining.
- Uses ensemble learning to improve model robustness and generalization across diverse query patterns.
- Leverages the structure of SPNs for efficient inference and scalable computation over complex relational schemas.
Experimental results
Research questions
- RQ1Can a data-driven model trained solely on database data outperform workload-driven models in cardinality estimation accuracy?
- RQ2Does a data-driven approach generalize better to unseen query patterns than workload-driven models?
- RQ3Can a single learned model support multiple database tasks, including query answering, cardinality estimation, and machine learning, without retraining?
- RQ4How does the performance of the data-driven model scale with data size and schema complexity?
- RQ5To what extent can the model handle dynamic data updates without retraining?
Key findings
- DeepDB achieves order-of-magnitude better cardinality estimation accuracy than the workload-driven MCSN model on unseen queries with four or more joins.
- The data-driven RSPN model generalizes significantly better than workload-driven models, as shown by lower error rates on out-of-distribution queries.
- DeepDB supports ad-hoc queries and data updates without retraining, while maintaining high accuracy across all tasks.
- The same RSPN model achieves RMSE comparable to standard machine learning models in regression tasks, with zero additional training time.
- Model training for DeepDB takes less than 3 hours and is performed only once, unlike workload-driven models that require repeated, expensive query execution for retraining.
- DeepDB outperforms both traditional and state-of-the-art learned DBMS components in query processing and cardinality estimation across all evaluated benchmarks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.