Proceedings of the VLDB Endowment · 2018 · 60 citations · 33 references
ComputingComputer ScienceInformation SystemsAlgorithmsData ManagementDatabasesDatabase ManagementEquivalence CheckingProof AssistantsQuery ProcessingRelational DatabasesStructured Query LanguageAxiomsIntegrity ConstraintsQuery EquivalenceQuery Rewrite RulesRelational Query LanguagesRelational Query Processing
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 Lean 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 68 equivalent queries and rewrite rules from both classical data management research papers and real-world SQL engines, where many of them have never been proven correct before.
33
Choice Reviews Online · 1995 · 1.8K citations
Optimal implementation of conjunctive queries in relational data bases
Ashok K. Chandra, Philip M. Merlin · 1977 · 1.2K citations · Full text
Michael Armbrust, Reynold Xin, Cheng Lian et al. · 2015 · 1.2K citations
Todd J. Green, Grigoris Karvounarakis, Val Tannen · 2007 · 799 citations · Full text
Sergey Melnik, Andrey Gubarev, Jing Jing Long et al. · Proceedings of the VLDB Endowment · 2010 · 709 citations