Lune

SIGMOD2023顶会

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Avoiding Materialisation for Guarded Aggregate Queries 引用了 Conjunctive Queries with Comparisons
  • Relational Algorithms for Top-k Query Evaluation 引用了 Conjunctive Queries with Comparisons
  • Succinct Structure Representations for Efficient Query Optimization 引用了 Relational Algorithms for Top-k Query Evaluation
  • Succinct Structure Representations for Efficient Query Optimization 引用了 Yannakakis+: Practical Acyclic Query Evaluation with Theoretical Guarantees
  • Succinct Structure Representations for Efficient Query Optimization 引用了 Conjunctive Queries with Comparisons
  • Yannakakis+: Practical Acyclic Query Evaluation with Theoretical Guarantees 引用了 Relational Algorithms for Top-k Query Evaluation
  • Yannakakis+: Practical Acyclic Query Evaluation with Theoretical Guarantees 引用了 Conjunctive Queries with Comparisons
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. Avoiding Materialisation for Guarded Aggregate QueriesMatthias Lanzinger, Reinhard Pichler, Alexander SelzerVLDB 2025 · 7 次引用
  2. Yannakakis+: Practical Acyclic Query Evaluation with Theoretical GuaranteesQichen Wang, Bingnan Chen, Binyang Dai, Ke Yi 等SIGMOD 2025 · 7 次引用
  3. Relational Algorithms for Top-k Query EvaluationQichen Wang, Qiyao Luo, Yilei WangSIGMOD 2024 · 5 次引用
  4. Succinct Structure Representations for Efficient Query OptimizationZhekai Jiang, Qichen Wang, Christoph KochSIGMOD 2026

它引用的 Paper3

  1. Conjunctive Queries with ComparisonsQichen Wang, Ke YiSIGMOD 2022 · 13 次引用
  2. Computing Complex Temporal Join Queries EfficientlyXiao Hu, Stavros Sintos, Junyang Gao, Pankaj K. Agarwal 等SIGMOD 2022 · 9 次引用
  3. Density-optimized Intersection-free Mapping and Matrix Multiplication for Join-Project OperationsZichun Huang, Shimin ChenVLDB 2022 · 9 次引用

相关 Paper

  1. Aggregated Deletion Propagation for Counting Conjunctive Query AnswersXiao Hu, Shouzhuo Sun, Shweta Patwa, Debmalya Panigrahi 等VLDB 2021 · 7 次引用
  2. A Compiler for Fused Relational Operations on MultisetsJames Dong, Fredrik KjolstadPLDI 2026
  3. Towards a Converged Relational-Graph Optimization FrameworkYunkai Lou, Longbin Lai, Bingqing Lyu, Yufan Yang 等SIGMOD 2025 · 4 次引用
  4. Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation SearchPinhan Zhao, Yuepeng Wang, Xinyu WangPLDI 2025
  5. SPES: A Symbolic Approach to Proving Query Equivalence Under Bag SemanticsQi Zhou, Joy Arulraj, Shamkant B. Navathe, William Harris 等ICDE 2022 · 19 次引用
黄昏的海面,两侧是细线勾勒的悬崖