VeriEQL:带完整性约束的复杂SQL查询的有界等价性验证
VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity Constraints
AI总结:
提出首个基于SMT的复杂SQL查询有界等价性验证工具VeriEQL,通过新的逻辑编码处理排序、CASE等复杂特性,在2万多个基准上性能优于现有技术一个数量级,并能生成反例辅助下游任务。
摘要:
SQL查询等价性检查任务在多种真实世界应用中(包括查询重写和自动评分)具有重要意义,这些应用涉及带有完整性约束的复杂查询;然而,现有最先进的技术在推理真实查询中的复杂特性(例如涉及排序、CASE语句、丰富完整性约束等)方面的能力非常有限。据我们所知,我们提出了首个基于SMT的方法及其实现VeriEQL,该方法能够证明和反驳复杂SQL查询的有界等价性。VeriEQL基于一种新的逻辑编码,该编码使用带未解释函数的整数理论对符号元组上的查询语义进行建模。该方法简单且高度实用——我们在超过20,000个基准上的全面评估表明,VeriEQL在可证明或可反驳的基准数量方面,比所有最先进的技术都高出超过一个数量级。VeriEQL还能生成反例,为许多下游任务(如在MySQL和Apache Calcite等系统中发现严重错误)提供便利。
英文摘要:
The task of SQL query equivalence checking is important in various real-world applications (including query rewriting and automated grading) that involve complex queries with integrity constraints; yet, state-of-the-art techniques are very limited in their capability of reasoning about complex features (e.g., those that involve sorting, case statement, rich integrity constraints, etc.) in real-life queries. To the best of our knowledge, we propose the first SMT-based approach and its implementation, VeriEQL, capable of proving and disproving bounded equivalence of complex SQL queries. VeriEQL is based on a new logical encoding that models query semantics over symbolic tuples using the theory of integers with uninterpreted functions. It is simple yet highly practical -- our comprehensive evaluation on over 20,000 benchmarks shows that VeriEQL outperforms all state-of-the-art techniques by more than one order of magnitude in terms of the number of benchmarks that can be proved or disproved. VeriEQL can also generate counterexamples that facilitate many downstream tasks (such as finding serious bugs in systems like MySQL and Apache Calcite).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。