Lune

SIGMOD2024顶会

Keep It Simple: Testing Databases via Differential Query Plans

Jinsheng Ba, Manuel Rigger

摘要

Query optimizers perform various optimizations, many of which have been proposed to optimize joins. It is pivotal that these optimizations are correct, meaning that they should be extensively tested. Besides manually written tests, automated testing approaches have gained broad adoption. Such approaches semi-randomly generate databases and queries. More importantly, they provide a so-called test oracle that can deduce whether the system's result is correct. Recently, researchers have proposed a novel testing approach called Transformed Query Synthesis (TQS) specifically designed to find logic bugs in join optimizations. TQS is a sophisticated approach that splits a given input table into several sub-tables and validates the results of the queries that join these sub-tables by retrieving the given table. We studied TQS's bug reports, and found that 14 of 15 unique bugs were reported by showing discrepancies in executing the same query with different query plans. Therefore, in this work, we propose a simple alternative approach to TQS. Our approach enforces different query plans for the same query and validates that the results are consistent. We refer to this approach as Differential Query Plan (DQP) testing. DQP can reproduce 14 of the 15 unique bugs found by TQS, and found 26 previously unknown and unique bugs. These results demonstrate that a simple approach with limited novelty can be as effective as a complex, conceptually appealing approach. Additionally, DQP is complementary to other testing approaches for finding logic bugs. 81% of the logic bugs found by DQP cannot be found by NoREC and TLP, whereas DQP overlooked 86% of the bugs found by NoREC and TLP. We hope that the practicality of our approach---we implemented in less than 100 lines of code per system---will lead to its wide adoption.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 14 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Scaling Automated Database System Testing 引用了 Finding bugs in database systems via query partitioning
  • Scaling Automated Database System Testing 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Scaling Automated Database System Testing 引用了 Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction
  • Scaling Automated Database System Testing 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction 引用了 Finding bugs in database systems via query partitioning
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction 引用了 Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction 引用了 Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database Systems
  • Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database Systems 引用了 Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Finding bugs in database systems via query partitioning 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Finding bugs in database systems via query partitioning 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Finding bugs in database systems via query partitioning 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting optimization bugs in database engines via non-optimizing reference engine construction 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Detecting optimization bugs in database engines via non-optimizing reference engine construction 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction 引用了 Finding bugs in database systems via query partitioning
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction 引用了 Testing Database Engines via Pivoted Query Synthesis
  • APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems 引用了 Evaluating Fuzz Testing
  • Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database Systems 引用了 Finding bugs in database systems via query partitioning
  • Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database Systems 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database Systems 引用了 Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction
  • Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database Systems 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database Systems 引用了 Testing Database Engines via Pivoted Query Synthesis
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper14

  1. Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database ConstructionJiansen Song, Wensheng Dou, Yu Gao, Ziyu Cui 等VLDB 2024 · 13 次引用
  2. Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database ConstructionJiansen Song, Wensheng Dou, Yingying Zheng, Yu Gao 等VLDB 2025 · 6 次引用
  3. Scaling Automated Database System TestingSuyang Zhong, Manuel RiggerASPLOS 2026 · 4 次引用
  4. PBench: Workload Synthesizer with Real Statistics for Cloud Analytics BenchmarkingYan Zhou, Chunwei Liu, Bhuvan Urgaonkar, Zhengle Wang 等VLDB 2025 · 4 次引用
  5. Simple Testing Can Expose Most Critical Transaction Bugs: Understanding and Detecting Write-Specific Serializability Violations in Database SystemsZiyu Cui, Wensheng Dou, Yu Gao, Rui Yang 等VLDB 2025 · 4 次引用

它引用的 Paper14

  1. Evaluating Fuzz TestingGeorge Klees, Andrew Ruef, Benji Cooper, Shiyi Wei 等CCS 2018 · 753 次引用
  2. Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 次引用
  3. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 次引用
  4. Detecting optimization bugs in database engines via non-optimizing reference engine constructionManuel Rigger, Zhendong SuFSE 2020 · 104 次引用
  5. APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database SystemsJinho Jung, Hong Hu, Joy Arulraj, Taesoo Kim 等VLDB 2020 · 77 次引用

相关 Paper

  1. Detecting Logic Bugs of Join Optimizations in DBMSXiu Tang, Sai Wu, Dongxiang Zhang, Feifei Li 等SIGMOD 2023 · 34 次引用
  2. Testing Database Systems via Differential Query ExecutionJiansen Song, Wensheng Dou, Ziyu Cui, Qianwang Dai 等ICSE 2023 · 26 次引用
  3. SRS: Detecting Logic Bugs of Join Implementation in DBMSs via Set Relation SynthesisJinhui Lai, Chi Zhang, Bingyan Li, Chenglin Liang 等SIGMOD 2026 · 4 次引用
  4. Pinolo: Detecting Logical Bugs in Database Management Systems with Approximate Query SynthesisZongyin Hao, Quanfeng Huang, Chengpeng Wang, Jianfeng Wang 等USENIX ATC 2023 · 26 次引用
  5. A Set-Theoretic Approach to Detecting Logic Bugs in DBMS Inner Join OptimizationsCe Lyu, Changzheng Wei, Yanhao Wang, Jie Liang 等ICDE 2026
黄昏的海面,两侧是细线勾勒的悬崖