Skip to main content
QUICK REVIEW

[Paper Review] Database Learning: Toward a Database that Becomes Smarter Every Time

Yongjoo Park, Ahmad Shahab Tajik|arXiv (Cornell University)|Mar 16, 2017
Advanced Database Systems and QueriesComputer Science76 references35 citations
TL;DR

This paper introduces Database Learning (DBL), a novel framework that enables databases to become faster and more accurate over time by learning from past approximate query answers. Using the principle of maximum entropy, DBL builds and refines statistical models of underlying data distributions, allowing Verdict—a Spark SQL-based query engine—to answer new queries more efficiently with smaller samples, achieving up to 23.0× speedup for the same accuracy compared to existing AQP systems.

ABSTRACT

In today's databases, previous query answers rarely benefit answering future queries. For the first time, to the best of our knowledge, we change this paradigm in an approximate query processing (AQP) context. We make the following observation: the answer to each query reveals some degree of knowledge about the answer to another query because their answers stem from the same underlying distribution that has produced the entire dataset. Exploiting and refining this knowledge should allow us to answer queries more analytically, rather than by reading enormous amounts of raw data. Also, processing more queries should continuously enhance our knowledge of the underlying distribution, and hence lead to increasingly faster response times for future queries. We call this novel idea---learning from past query answers---Database Learning. We exploit the principle of maximum entropy to produce answers, which are in expectation guaranteed to be more accurate than existing sample-based approximations. Empowered by this idea, we build a query engine on top of Spark SQL, called Verdict. We conduct extensive experiments on real-world query traces from a large customer of a major database vendor. Our results demonstrate that Verdict supports 73.7% of these queries, speeding them up by up to 23.0x for the same accuracy level compared to existing AQP systems.

Motivation & Objective

  • To address the inefficiency of traditional databases, where past query work is discarded rather than reused.
  • To enable databases to learn from approximate query answers and refine their understanding of underlying data distributions.
  • To reduce response times for future queries by leveraging statistical models derived from historical query results.
  • To support a broad class of analytical SQL queries with principled, accurate, and fast approximate answers.
  • To develop a system that continuously improves its accuracy and performance as more queries are processed.

Proposed method

  • The system uses the principle of maximum entropy to infer the most likely data distribution consistent with past query answers, ensuring optimal accuracy under uncertainty.
  • It formulates each query as a set of linear constraints on the underlying data distribution, enabling analytical inference without iterative solvers.
  • The method models overlapping query ranges in multidimensional space using O(n) variables, avoiding the exponential blowup of traditional approaches.
  • Verdict, the implemented query engine on Spark SQL, integrates these models to answer new queries by combining model inference with minimal sampling.
  • The system dynamically updates its model after each query, refining confidence intervals and improving accuracy over time.
  • It supports complex, multi-column aggregates and overlapping ranges without requiring strict query containment or materialized views.

Experimental results

Research questions

  • RQ1Can past approximate query answers be systematically leveraged to improve the performance and accuracy of future queries?
  • RQ2How can a database learn from query results to reduce reliance on full data scans over time?
  • RQ3What statistical framework enables efficient, scalable, and accurate model refinement from overlapping query answers?
  • RQ4To what extent can a model-based approach outperform traditional sampling-based AQP in terms of speed and accuracy?
  • RQ5Can a database system achieve continuous performance improvement through incremental learning from query work?

Key findings

  • Verdict supports 73.7% of real-world analytical queries from a large enterprise customer’s query log.
  • For the same accuracy level, Verdict achieves up to 23.0× speedup compared to an online aggregation-based AQP system.
  • The system’s model accuracy improves with each new query, reducing the need for data sampling over time.
  • The maximum entropy approach enables analytical inference with O(n) variables, avoiding the O(2^n) complexity of prior methods.
  • The framework naturally captures data correlations without assuming smoothness or structure in advance.
  • The approach outperforms existing techniques like materialized views and COSMOS by supporting overlapping, multi-column queries without strict containment.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.