Query Weak Equivalence and its Verification in Analytical Databases
Jinguo You, Wanting Fu, Yuxuan Wang, Peilei He, Kaiqi Liu, Quanqing Xu
Abstract
Modern database applications operate on massive data and support a range of complex queries, especially OLAP queries which are time-consuming. To accelerate query processing, a variety of methods for automatically verifying query equivalence have been proposed to avoid redundant executions of equivalent queries, mainly in a semantic sense. However, we have observed some queries that are not semantically equivalent also return the same tuples under the specific data distribution, which cannot be detected by most current automated verification of query equivalence. To deal with this issue, this paper proposes weak equivalence for identifying queries that are not semantically equivalent but produce the same results under the read-mostly scenarios such as OLAP. Specifically, for posed queries, we extract their filter condition expressions, which are then transformed into symbolic representations, namely first-order logic formulae. In terms of their partial order, i.e. containment relationship, we introduce Query Lattice, a novel structure that is constructed as a lattice which is partitioned into equivalence classes that are convex to answer queries if we determine they belong to the classes. The equivalence class enables stored queries to respond to future unseen queries so that redundant generation of query plan and execution can be bypassed. Experimental evaluation of Query Lattice built on top of a prevailing open-source DBMS, PostgreSQL shows that the maximum improvement that Query Lattice can achieve is 44.95 % over the original PostgreSQL, when running on the datasets of both TPC-H and TPC-H Skew benchmarks.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get f1cf9a4f-699f-44e3-9ca4-78dae6a4c62aRelated papers
- SPES: A Symbolic Approach to Proving Query Equivalence Under Bag SemanticsQi Zhou, Joy Arulraj, Shamkant B. Navathe, William Harris et al.ICDE 2022 · 19 citations
- ParSEval: Plan-aware Test Database Generation for SQL Equivalence EvaluationChunyu Chen, Zhengjie Miao, Yong Zhang, Jiannan WangVLDB 2025 · 1 citation
- Quantifying TPC-H Choke Points and Their OptimizationsMarkus Dreseler, Martin Boissier, Tilmann Rabl, Matthias UflackerVLDB 2020 · 91 citations
- Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation SearchPinhan Zhao, Yuepeng Wang, Xinyu WangPLDI 2025
- QED: A Powerful Query Equivalence Decider for SQLShuxian Wang, Sicheng Pan, Alvin CheungVLDB 2024 · 19 citations
