Computing the Difference of Conjunctive Queries Efficiently
Xiao Hu, Qichen Wang
摘要
We investigate how to efficiently compute the difference result of two (or multiple) conjunctive queries, which is the last operator in relational algebra to be unraveled. The standard approach in practical database systems is to materialize the results for every input query as a separate set, and then compute the difference of two (or multiple) sets. This approach is bottlenecked by the complexity of evaluating every input query individually, which could be very expensive, particularly when there are only a few results in the difference. In this paper, we introduce a new approach by exploiting the structural property of input queries and rewriting the original query by pushing the difference operator down as much as possible. We show that for a large class of difference queries, this approach can lead to a linear-time algorithm, in terms of the input size and (final) output size, i.e., the number of query results that survive from the difference operator. We complete this result by showing the hardness of computing the remaining difference queries in linear time. Although a linear-time algorithm is hard to achieve in general, we also provide some heuristics that can provably improve the standard approach. At last, we compare our approach with standard SQL engines over graph and benchmark datasets. The experiment results demonstrate order-of-magnitude speedups achieved by our approach over the vanilla SQL engine.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper4
- Avoiding Materialisation for Guarded Aggregate QueriesMatthias Lanzinger, Reinhard Pichler, Alexander SelzerVLDB 2025 · 被引用 7 次
- Yannakakis+: Practical Acyclic Query Evaluation with Theoretical GuaranteesQichen Wang, Bingnan Chen, Binyang Dai, Ke Yi 等SIGMOD 2025 · 被引用 7 次
- Relational Algorithms for Top-k Query EvaluationQichen Wang, Qiyao Luo, Yilei WangSIGMOD 2024 · 被引用 5 次
- Succinct Structure Representations for Efficient Query OptimizationZhekai Jiang, Qichen Wang, Christoph KochSIGMOD 2026
它引用的顶会 Paper3
- Conjunctive Queries with ComparisonsQichen Wang, Ke YiSIGMOD 2022 · 被引用 13 次
- Computing Complex Temporal Join Queries EfficientlyXiao Hu, Stavros Sintos, Junyang Gao, Pankaj K. Agarwal 等SIGMOD 2022 · 被引用 9 次
- Density-optimized Intersection-free Mapping and Matrix Multiplication for Join-Project OperationsZichun Huang, Shimin ChenVLDB 2022 · 被引用 9 次
相关 Paper
- Aggregated Deletion Propagation for Counting Conjunctive Query AnswersXiao Hu, Shouzhuo Sun, Shweta Patwa, Debmalya Panigrahi 等VLDB 2021 · 被引用 7 次
- A Compiler for Fused Relational Operations on MultisetsJames Dong, Fredrik KjolstadPLDI 2026
- Towards a Converged Relational-Graph Optimization FrameworkYunkai Lou, Longbin Lai, Bingqing Lyu, Yufan Yang 等SIGMOD 2025 · 被引用 4 次
- Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation SearchPinhan Zhao, Yuepeng Wang, Xinyu WangPLDI 2025
- SPES: A Symbolic Approach to Proving Query Equivalence Under Bag SemanticsQi Zhou, Joy Arulraj, Shamkant B. Navathe, William Harris 等ICDE 2022 · 被引用 19 次
