Introduction
As databases evolved in the late 1990s to handle complex media like images, spatial data, and large text corpora, a significant performance bottleneck emerged: the "expensive predicate." Unlike simple integer comparisons, identifying images "similar" to a sunset or detecting copyright overlaps in documents requires computationally intensive algorithms. In their 1998 paper, Shivakumar et al. proposed a framework to mitigate this by using approximate predicates—computationally cheap, "fuzzy" filters designed to discard irrelevant data before expensive, "ideal" predicates are applied.
The Problem: Balancing Cost and Accuracy
Traditional query optimizers excel at reordering joins and simple filters but struggle with User-Defined Predicates (UDPs). A common optimization is using a "bounding box" check before a complex polygon intersection test. However, such approximations introduce a fundamental trade-off:
- False Positives ($p$): The approximation incorrectly identifies a match, requiring a follow-up test with the expensive ideal predicate. This increases cost but preserves accuracy.
- False Negatives ($n$): The approximation incorrectly discards a valid record. This reduces cost but results in incomplete query results.
The core challenge lies in automatically selecting and ordering multiple approximate filters to minimize execution cost while staying within a user-defined "error budget."
Methodology: The Wrapper Architecture
The authors introduced a Wrapper Architecture that layers on top of a Traditional Query Optimizer (TQO). This wrapper generates "extended" query plans incorporating approximate predicates and leverages the TQO to estimate their costs.
Formal Modeling and Composition
Predicates are formally defined by their selectivity ($s$), cost ($e$), and error rates ($p, n$). To handle complex filters, the paper introduces the Sequenced (SQN) operator. Unlike a standard logical AND, the SQN operator explicitly defines the evaluation order, which is vital for cost optimization—ensuring the cheapest, most selective filters are executed first.
Optimization Algorithms
Two primary algorithms were proposed for plan selection:
- Conjunctive Wrapper: An optimal algorithm for finding the best combination of filters, though it operates in exponential time.
- Linear Wrapper: A polynomial-time heuristic that greedily builds filters by ranking predicates based on a "goodness" metric (cost vs. selectivity).
Evaluation and Key Results
The framework was evaluated using simulated datasets and real-world systems like QBIC (image content matching) and SCAM (copyright detection).
Cost-Error Trade-offs
Experimental results demonstrated that allowing even a marginal false negative rate (e.g., 1%) can lead to dramatic reductions in execution cost. As shown in Figure 6, different sequences of approximate predicates (labeled $I$ for index-based and $A$ for tuple-based) result in vastly different performance profiles.
Key findings include:
- Massive Speedups: Approximate predicates reduced normalized query costs by 10x to 100x compared to using only ideal predicates.
- Heuristic Efficiency: The Linear Wrapper produced query plans nearly as effective as the optimal Conjunctive Wrapper, making it a practical choice for real-time optimization.
Conclusion
This research established a foundational approach for balancing performance and precision in database systems. By treating "error" as a tunable parameter, the authors provided a path for modern systems to handle expensive user-defined functions efficiently. While the models rely on certain independence assumptions, the core idea of multi-stage filtering remains central to high-performance search and recommendation engines today.
Summary updated