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

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: He, Yang, Zhao, Pinhan, Wang, Xinyu, Wang, Yuepeng
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910368797818880
author He, Yang
Zhao, Pinhan
Wang, Xinyu
Wang, Yuepeng
author_facet He, Yang
Zhao, Pinhan
Wang, Xinyu
Wang, Yuepeng
contents 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).
format Preprint
id arxiv_https___arxiv_org_abs_2403_03193
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity Constraints
He, Yang
Zhao, Pinhan
Wang, Xinyu
Wang, Yuepeng
Programming Languages
Databases
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).
title VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity Constraints
topic Programming Languages
Databases
url https://arxiv.org/abs/2403.03193