Lune

FSE2020Top-tier venue

Detecting optimization bugs in database engines via non-optimizing reference engine construction

Manuel Rigger, Zhendong Su

Abstract

Database Management Systems (DBMS) are used ubiquitously. To efficiently access data, they apply sophisticated optimizations. Incorrect optimizations can result in logic bugs, which cause a query to compute an incorrect result set. We propose Non-Optimizing Reference Engine Construction (NoREC), a fully-automatic approach to detect optimization bugs in DBMS. Conceptually, this approach aims to evaluate a query by an optimizing and a non-optimizing version of a DBMS, to then detect differences in their returned result set, which would indicate a bug in the DBMS. Obtaining a non-optimizing version of a DBMS is challenging, because DBMS typically provide limited control over optimizations. Our core insight is that a given, potentially randomly-generated optimized query can be rewritten to one that the DBMS cannot optimize. Evaluating this unoptimized query effectively corresponds to a non-optimizing reference engine executing the original query. We evaluated NoREC in an extensive testing campaign on four widely-used DBMS, namely PostgreSQL, MariaDB, SQLite, and CockroachDB. We found 159 previously unknown bugs in the latest versions of these systems, 141 of which have been fixed by the developers. Of these, 51 were optimization bugs, while the remaining were error and crash bugs. Our results suggest that NoREC is effective, general and requires little implementation effort, which makes the technique widely applicable in practice.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

71 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • On the unusual effectiveness of type-aware operator mutations for testing SMT solvers cites APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Finding bugs in database systems via query partitioning cites APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Finding bugs in database systems via query partitioning cites Testing Database Engines via Pivoted Query Synthesis
  • Testing Database Engines via Query Plan Guidance cites Finding bugs in database systems via query partitioning
  • Testing Database Engines via Query Plan Guidance cites APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Testing Database Engines via Query Plan Guidance cites Testing Database Engines via Pivoted Query Synthesis
  • MT-Teql: Evaluating and Augmenting Neural NLIDB on Real-world Linguistic and Schema Variations cites Finding bugs in database systems via query partitioning
  • MT-Teql: Evaluating and Augmenting Neural NLIDB on Real-world Linguistic and Schema Variations cites Testing Database Engines via Pivoted Query Synthesis
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers71

  1. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 citations
  2. On the unusual effectiveness of type-aware operator mutations for testing SMT solversDominik Winterer, Chengyu Zhang, Zhendong SuOOPSLA 2020 · 55 citations
  3. GrayC: Greybox Fuzzing of Compilers and Analysers for CKarine Even-Mendoza, Arindam Sharma, Alastair F. Donaldson, Cristian CadarISSTA 2023 · 52 citations
  4. Testing Database Engines via Query Plan GuidanceJinsheng Ba, Manuel RiggerICSE 2023 · 39 citations
  5. MT-Teql: Evaluating and Augmenting Neural NLIDB on Real-world Linguistic and Schema VariationsPingchuan Ma, Shuai WangVLDB 2022 · 38 citations

Builds on2

  1. Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 citations
  2. APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database SystemsJinho Jung, Hong Hu, Joy Arulraj, Taesoo Kim et al.VLDB 2020 · 77 citations

Related papers

  1. Constant Optimization Driven Database System TestingChi Zhang, Manuel RiggerSIGMOD 2025 · 8 citations
  2. Testing Database Systems via Differential Query ExecutionJiansen Song, Wensheng Dou, Ziyu Cui, Qianwang Dai et al.ICSE 2023 · 26 citations
  3. EPSC: Testing Database Management Systems via Equivalent Prepared Statement ConstructionChi Zhang, Jie Liang, Zhiyong Wu, Dalong Shi et al.SIGMOD 2026 · 2 citations
  4. Detecting Logic Bugs in DBMSs via Equivalent Data ConstructionWenqian Deng, Jie Liang, Zhiyong Wu, Jingzhou Fu et al.SIGMOD 2026 · 1 citation
  5. Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database ConstructionJiansen Song, Wensheng Dou, Yu Gao, Ziyu Cui et al.VLDB 2024 · 13 citations
Dusk over the sea between two cliffs drawn in fine vertical lines