Introduction
Traditional database systems are highly optimized for selection predicates—filtering rows based on specific criteria like price < 50. However, modern data-driven decision-making often involves Aggregation Constrained Queries (ACQs). In an ACQ, the goal is not just to filter data, but to ensure the aggregate of the result set meets a specific target.
Consider an advertiser defining a target audience. They might select specific cities and age ranges, but their ultimate goal is to reach a minimum audience size (e.g., 1 million people) to justify a campaign budget. If the initial filters return only 400,000 users, the advertiser must manually "relax" their query—adding more cities or widening the age range—through a tedious trial-and-error process. This manual refinement is inefficient and often results in queries that are broader than necessary, losing the original intent.
The ACQUIRE Framework
To automate and optimize this process, the authors propose ACQUIRE, an algorithm designed to refine queries until they satisfy aggregate constraints while minimizing the "distance" from the user's original intent. ACQUIRE operates through a continuous feedback loop between the application and the database management system (DBMS).
The framework consists of two primary phases:
Phase I: Expand (Searching the Solution Space)
ACQUIRE treats query refinement as a geometric search problem. It maps all possible refinements onto a multi-dimensional "Refined Space," where each axis represents a filter that can be adjusted. Using a breadth-first search strategy, the algorithm explores this grid to identify the "cheapest" refinements—those that stay closest to the original query parameters.
Phase II: Explore (Incremental Aggregate Computation)
The most significant bottleneck in query refinement is the cost of re-executing modified queries. ACQUIRE overcomes this by exploiting the Optimal Substructure Property of common aggregates like COUNT, SUM, and MAX.
Instead of re-running a refined query from scratch, ACQUIRE decomposes the query volume into smaller geometric components: Cells, Pillars, Walls, and Blocks. By caching the results of previously computed components, the system can calculate the aggregate for a new, expanded query by simply adding the delta (a "cell" of new data) to the existing results.
Evaluation and Results
The researchers evaluated ACQUIRE using the industry-standard TPC-H benchmark and synthetic skewed datasets to simulate real-world data distributions. The results demonstrate that ACQUIRE significantly outperforms existing methods:
- Performance: ACQUIRE achieved speedups of up to 100x compared to traditional re-execution strategies.
- Precision: The refinements produced were 2x closer to the user's original intent, ensuring that the expanded query remained semantically relevant.
- Robustness: The algorithm maintained consistent performance across various aggregate types (
COUNT,SUM,MIN,MAX,AVG) and handled non-uniform data distributions effectively.
Conclusion
ACQUIRE represents a major step forward in making databases more "intent-aware." By transforming query refinement into a geometric optimization problem and utilizing incremental computation, it removes the burden of manual trial-and-error from the user. While currently focused on numerical range predicates, the framework's underlying principles of geometric decomposition and result reuse provide a foundation for more complex query optimization in the future.
Summary updated