QED: A Powerful Query Equivalence Decider for SQL
Shuxian Wang, Sicheng Pan, Alvin Cheung
摘要
Checking query equivalence is of great significance in database systems. Prior work in automated query equivalence checking sets the first steps in formally modeling and reasoning about query optimization rules, but only supports a limited number of query features. In this paper, we present Qed, a new framework for query equivalence checking based on bag semantics. Qed uses a new formalism called Q-expressions that models queries using different normal forms for efficient equivalence checking, and models features such as integrity constraints and NULLs in a principled way unlike prior work. Our formalism also allows us to define a new query fragment that encompasses many real-world queries with a complete equivalence checking algorithm, assuming a complete first-order theory solver. Empirically, Qed can verify 299 out of 444 query pairs extracted from the Calcite framework and 979 out of 1287 query pairs extracted from CockroachDB, which is more than 2× the number of cases proven by prior state-of-the-art solver.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- ParSEval: Plan-aware Test Database Generation for SQL Equivalence Evaluation 引用了 SPES: A Symbolic Approach to Proving Query Equivalence Under Bag Semantics
- Proving Cypher Query Equivalence 引用了 SPES: A Symbolic Approach to Proving Query Equivalence Under Bag Semantics
- SpotIt: Evaluating Text-to-SQL Evaluation with Formal Verification 引用了 SPES: A Symbolic Approach to Proving Query Equivalence Under Bag Semantics
- Optimal Predicate Pushdown Synthesis 引用了 SPES: A Symbolic Approach to Proving Query Equivalence Under Bag Semantics
- Automated Discovery of Test Oracles for Database Management Systems Using LLMs 引用了 ParSEval: Plan-aware Test Database Generation for SQL Equivalence Evaluation
引用它的顶会 Paper7
- SpotIt: Evaluating Text-to-SQL Evaluation with Formal VerificationRocky Klopfenstein, Yang He, Andrew Tremante, Yuepeng Wang 等ICLR 2026 · 6 次引用
- Proving Cypher Query EquivalenceLei Tang, Wensheng Dou, Yingying Zheng, Lijie Xu 等ICDE 2025 · 3 次引用
- ParSEval: Plan-aware Test Database Generation for SQL Equivalence EvaluationChunyu Chen, Zhengjie Miao, Yong Zhang, Jiannan WangVLDB 2025 · 1 次引用
- Optimal Predicate Pushdown SynthesisRobert Zhang, Eric Hayden Campbell, Dixin Tang, Isil DilligPLDI 2026 · 1 次引用
- Automated Discovery of Test Oracles for Database Management Systems Using LLMsQiuyang Mang, Runyuan He, Suyang Zhong, Xiaoxuan Liu 等SIGMOD 2026 · 1 次引用
它引用的 Paper1
相关 Paper
- VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity ConstraintsYang He, Pinhan Zhao, Xinyu Wang, Yuepeng WangOOPSLA 2024 · 12 次引用
- Proving Query Equivalence Using Linear Integer ArithmeticHaoran Ding, Zhaoguo Wang, Yicun Yang, Dexin Zhang 等SIGMOD 2024 · 20 次引用
- Query Weak Equivalence and its Verification in Analytical DatabasesJinguo You, Wanting Fu, Yuxuan Wang, Peilei He 等ICDE 2025 · 1 次引用
- Equivalence-Invariant Algebraic Provenance for Hyperplane Update QueriesPierre Bourhis, Daniel Deutch, Yuval MoskovitchSIGMOD 2020 · 6 次引用
- Translating canonical SQL to imperative code in CoqVéronique Benzaken, Evelyne Contejean, Mohammed Houssem Hachmaoui, Chantal Keller 等OOPSLA 2022 · 3 次引用
