paperbot · PL 论文追踪

全部论文 待读 收藏

P2 VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity Constraints

VeriEQL:带完整性约束的复杂 SQL 查询的有界等价性验证
OOPSLA 8(OOPSLA1)2024匹配度 3/10 · 论文属于经典静态分析与形式化验证,用 SMT 对复杂 SQL 查询做有界等价性验证,并强调工业 bug 发现;但用户的核心方向是 PL 与 AI/LLM/Agent 的交叉、浮点程序分析或贝叶斯程序分析,该论文不涉及 LLM、Agentic 程序、机器学习系统、浮点或贝叶斯分析。引用 12 inbox
Yang He, Pinhan Zhao, Xinyu Wang, Yuepeng Wang
crossref: 2026-09-10

AI 速览

一句话:提出首个基于 SMT 的复杂 SQL 查询有界等价性验证方法,可证明与反驳查询等价性并生成反例。

SQL 查询等价性检查在查询重写、自动评分等实际应用中十分重要,但现有技术难以推理真实查询中的排序、case 语句和丰富完整性约束等复杂特性。本文提出首个基于 SMT 的方法及其实现 VeriEQL,能够证明和反驳复杂 SQL 查询的有界等价性。其核心是一种新的逻辑编码,在符号元组上使用带未解释函数的整数理论来建模查询语义,简单而实用。作者在超过 20,000 个基准上进行了综合评估,VeriEQL 能证明或反驳的基准数量比所有最先进技术高出一个数量级以上;它还能生成反例,助力发现 MySQL 和 Apache Calcite 等系统中的严重 bug。

问题
现有 SQL 查询等价性检查技术难以处理包含排序、case 语句和丰富完整性约束等复杂特性的真实查询。
方法
提出基于 SMT 的方法 VeriEQL,采用在符号元组上用整数理论与未解释函数建模查询语义的新逻辑编码,支持有界等价性的证明与反驳。
评估
在超过 20,000 个基准上进行综合评估,可证明或反驳的基准数比最先进技术高一个数量级以上,并能生成反例以发现 MySQL 和 Apache Calcite 等系统中的严重 bug。
原文摘要(Abstract)

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).

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2545,
  title = {VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity Constraints},
  author = {Yang He and Pinhan Zhao and Xinyu Wang and Yuepeng Wang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA1},
  year = {2024},
  doi = {10.1145/3649849}
}