go back
go back
Volume 18, No. 11
ParSEval: Plan-aware Test Database Generation for SQL Equivalence Evaluation
Abstract
Deciding query equivalence has played an essential role in many real-world applications, including evaluating the accuracy of textto-SQL models, where one needs to compare model-generated queries against ground truth queries. Although query equivalence is undecidable in general, researchers have developed two significant approaches to check query equivalence: formal verification-based and test-case-based. Verification-based solutions ensure correctness but may lack support for advanced SQL features and cross-database adaptability. Test cases are versatile but suffer from ad-hoc constraints and potential incorrectness (false positives). In this paper, we propose ParSEval , a Plan-aware SQL Equivalence evaluation framework to generate test database instances for given queries. We observed that existing test data generation methods fail to fully explore the query structure. To address this limitation, ParSEval formally models specific behaviors of each query operator and considers all possible execution paths of the logical query plan by adapting the notion of branch coverage. We validated the effectiveness and efficiency of ParSEval on four datasets with AI-generated and human-crafted queries. The experimental results show that ParSEval supports up to 40% more query pairs than state-of-the-art verification-based approaches. Compared to existing test-case-based approaches, ParSEval reveals more nonequivalent pairs while being 21 × faster.
PVLDB is part of the VLDB Endowment Inc.
Privacy Policy