[Paper Review] Model-based Approximate Query Processing
This paper introduces Model-based Approximate Query Processing (AQP), a novel approach that uses generative models—specifically Sum-Product Networks (SPNs)—to deliver fast, accurate query estimates for interactive data exploration. Unlike classical AQP methods that rely on pre-sampled data or online sampling (which struggle with rare subpopulations), model-based AQP learns the joint probability distribution of the full database at training time, enabling high-quality approximations for arbitrary ad-hoc queries, including those over rare groups, with sub-second response times even on large datasets.
Interactive visualizations are arguably the most important tool to explore, understand and convey facts about data. In the past years, the database community has been working on different techniques for Approximate Query Processing (AQP) that aim to deliver an approximate query result given a fixed time bound to support interactive visualizations better. However, classical AQP approaches suffer from various problems that limit the applicability to support the ad-hoc exploration of a new data set: (1) Classical AQP approaches that perform online sampling can support ad-hoc exploration queries but yield low quality if executed over rare subpopulations. (2) Classical AQP approaches that rely on offline sampling can use some form of biased sampling to mitigate these problems but require a priori knowledge of the workload, which is often not realistic if users want to explore a new database. In this paper, we present a new approach to AQP called Model-based AQP that leverages generative models learned over the complete database to answer SQL queries at interactive speeds. Different from classical AQP approaches, generative models allow us to compute responses to ad-hoc queries and deliver high-quality estimates also over rare subpopulations at the same time. In our experiments with real and synthetic data sets, we show that Model-based AQP can in many scenarios return more accurate results in a shorter runtime. Furthermore, we think that our techniques of using generative models presented in this paper can not only be used for AQP in databases but also has applications for other database problems including Query Optimization as well as Data Cleaning.
Motivation & Objective
- To address the limitations of classical Approximate Query Processing (AQP) in supporting ad-hoc, interactive data exploration on new databases.
- To overcome the poor performance of online sampling on rare subpopulations and the workload-dependency of offline sampling techniques.
- To enable high-quality, low-latency query approximations without requiring prior knowledge of the query workload.
- To explore the use of generative models, particularly Sum-Product Networks (SPNs), as a foundation for scalable and accurate AQP.
- To extend AQP capabilities to complex queries, including joins and nested subqueries, while maintaining accuracy and performance.
Proposed method
- Leverages Sum-Product Networks (SPNs) to learn the joint probability distribution of the entire database during a pre-processing phase.
- Uses the learned SPN to compute probability estimates directly for simple aggregate queries (e.g., COUNT, AVG) without sampling.
- For complex queries, generates stratified samples on-the-fly from the SPN to ensure coverage of rare subpopulations.
- Supports user-defined functions and complex SQL constructs by sampling from the model's learned distribution.
- Combines individual SPNs per table at query time to approximate results for join and nested queries.
- Employs confidence bounds estimation to quantify uncertainty in query approximations.
Experimental results
Research questions
- RQ1Can generative models like SPNs provide more accurate and faster query approximations than classical AQP methods for ad-hoc queries?
- RQ2Can model-based AQP maintain high accuracy even for queries over rare subpopulations where traditional online sampling fails?
- RQ3How does the runtime of model-based AQP scale with data size compared to traditional AQP techniques?
- RQ4Can SPNs be effectively used to approximate complex queries, including joins and nested subqueries?
- RQ5How does the quality of the SPN model impact the accuracy of AQP results, and can hybrid models improve performance?
Key findings
- Model-based AQP achieves higher accuracy than classical AQP approaches on both real and synthetic datasets, particularly for queries over rare subpopulations.
- The runtime of model-based AQP depends primarily on the size of the SPN, not the data size, enabling sub-second response times even on large databases.
- The method successfully generates stratified samples on-the-fly, ensuring reliable estimates for rare subpopulations where traditional online sampling fails.
- SPNs enable direct probability estimation for simple aggregates and sample generation for complex queries, supporting a wide range of SQL operations.
- The approach supports confidence bounds estimation, allowing users to assess the reliability of approximate results.
- Preliminary results suggest that hybrid SPNs—combining model and original data—can further improve accuracy by preserving strong attribute correlations.
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.