Abstract
Rank join queries are fundamental for retrieving the top-k results from multiple relations based on a scoring function. However, real-world queries often include aggregation constraints (e.g., total cost limits) that traditional rank join algorithms handle inefficiently via post-filtering. This paper presents novel deterministic and probabilistic algorithms that integrate these constraints directly into the join process. By leveraging the mathematical properties of constraints and introducing a subsumption-based pruning technique, the proposed methods significantly reduce execution time and memory overhead compared to state-of-the-art approaches.
Introduction
In modern data-driven applications, users frequently seek the "best" combinations of items from disparate sources, such as travel packages or product bundles. These are typically modeled as rank join queries. However, a significant limitation of standard rank join operators is their inability to efficiently handle auxiliary constraints, such as a maximum total budget or a minimum quality threshold for individual components.
The conventional "post-filtering" approach—where the rank join is completed first and results are subsequently filtered—is often highly inefficient. It may process and join numerous tuples that are eventually discarded for violating constraints. This paper addresses the challenge of early pruning: stopping the search and discarding unpromising data as soon as it is mathematically certain they cannot contribute to the final top-k result set.
Methodology
The authors propose two primary strategies for constraint-aware rank joins:
- Deterministic kRJAC Algorithm: This approach classifies constraints based on their monotonicity. Monotone constraints (e.g., $MAX(A, p) \ge \lambda$) and anti-monotone constraints (e.g., $SUM(A, p) \le \lambda$) are used to bound the search space. A central innovation is Subsumption-based Pruning. A tuple is "subsumed" and can be safely removed from memory if at least $k$ other observed tuples are superior in both their contribution to the ranking score and their ability to satisfy the aggregate constraints.
- Probabilistic Pruning: For environments where data access is costly (e.g., remote APIs), a probabilistic variant uses histograms and selectivity estimation. It terminates the search when the probability that unseen data could yield a better result than the current top-k set falls below a specific threshold.
Experimental Evaluation
The algorithms were tested on synthetic datasets with uniform and exponential distributions to simulate various data skews. Join selectivity was maintained at 0.01.
The results demonstrate that the proposed SubS-Pruning and Adaptive SubS-Pruning algorithms consistently outperform the post-filtering baseline. As shown in the performance metrics, the execution time for post-filtering grows rapidly with $k$, whereas the proposed pruning methods maintain significantly lower and more stable latencies.
Key observations include:
- Pruning Power: Anti-monotone constraints provide the most effective pruning, allowing the system to discard "heavy" tuples early in the pipeline.
- Memory Efficiency: The deterministic algorithm effectively minimizes the number of tuples retained in memory.
- Probabilistic Trade-offs: The probabilistic algorithm achieved the fastest execution times with minimal loss in result accuracy (typically within 0.5% of the exact top-k values).
Conclusion and Future Work
This research demonstrates that integrating aggregation constraints into the rank join process offers substantial performance gains. By treating constraints as pruning opportunities rather than post-processing burdens, the proposed algorithms enable faster and more memory-efficient top-k query processing. Future work includes extending these techniques to handle a larger number of relations, exploring rank outer-joins, and developing cost-based optimizers to automatically select the most effective pruning strategy for a given query profile.
Summary updated