arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1802.02229cs.DBcs.PL
收藏

判定SQL语义等价的公理化基础和算法

Axiomatic Foundations and Algorithms for Deciding Semantic Equivalences of SQL Queries

Shumo Chu, Brendan Murphy, Jared Roesch, Alvin Cheung, Dan Suciu

摘要:

确定SQL查询的等价性是数据管理中的一个基本问题。由于以前的工作主要集中在研究问题的理论局限性,很少有实现检查这样的等价性存在。在本文中,我们提出了一个新的形式主义和实现推理的等价SQL查询。我们的形式主义,U-半环,扩展SQL的半环语义与无界求和和重复消除。U-半环只使用很少的公理定义,因此可以很容易地使用证明助手,如Coq的自动查询推理实现。然而,它们足以使我们能够推理复杂的SQL查询,这些查询是在包和集合上评估的,以及各种完整性约束。为了评估U-半环的有效性,我们已经使用它来正式验证39个查询重写规则,从经典的数据管理研究论文和现实世界的SQL引擎,其中许多从来没有被证明是正确的。

英文摘要:

Deciding the equivalence of SQL queries is a fundamental problem in data management. As prior work has mainly focused on studying the theoretical limitations of the problem, very few implementations for checking such equivalences exist. In this paper, we present a new formalism and implementation for reasoning about the equivalences of SQL queries. Our formalism, U-semiring, extends SQL's semiring semantics with unbounded summation and duplicate elimination. U-semiring is defined using only very few axioms and can thus be easily implemented using proof assistants such as Coq for automated query reasoning. Yet, they are sufficient enough to enable us reason about sophisticated SQL queries that are evaluated over bags and sets, along with various integrity constraints. To evaluate the effectiveness of U-semiring, we have used it to formally verify 39 query rewrite rules from both classical data management research papers and real-world SQL engines, where many of them have never been proven correct before.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑