Lune

ICSE2024Top-tier venue

CERT: Finding Performance Issues in Database Systems Through the Lens of Cardinality Estimation

Jinsheng Ba, Manuel Rigger

Abstract

Database Management Systems (DBMSs) process a given query by creating a query plan, which is subsequently executed, to compute the query's result. Deriving an efficient query plan is challenging, and both academia and industry have invested decades into researching query optimization. Despite this, DBMSs are prone to performance issues, where a DBMS produces an unexpectedly inefficient query plan that might lead to the slow execution of a query. Finding such issues is a longstanding problem and inherently difficult, because no ground truth information on an expected execution time exists. In this work, we propose Cardinality Estimation Restriction Testing (CERT ), a novel technique that finds performance issues through the lens of cardinality estimation. Given a query on a database, CERT derives a more restrictive query (e.g., by replacing a LEFT JOIN with an INNER JOIN), whose estimated number of rows should not exceed the estimated number of rows for the original query. CERT tests cardinality estimation specifically, because it was shown to be the most important part for query optimization; thus, we expect that finding and fixing cardinality-estimation issues might result in the highest performance gains. In addition, we found that other kinds of query optimization issues can be exposed by unexpected estimated cardinalities, which can also be found by CERT . CERT is a black-box technique that does not require access to the source code; DBMSs expose query plans via the EXPLAIN statement. CERT eschews executing queries, which is costly and prone to performance fluctuations. We evaluated CERT on three widely used and mature DBMSs, MySQL, TiDB, and CockroachDB. CERT found 13 unique issues, of which 2 issues were fixed and 9 confirmed by the developers. We expect that this new angle on finding performance bugs will help DBMS developers in improving DMBSs' performance.

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.

14 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

  • Keep It Simple: Testing Databases via Differential Query Plans cites Testing Database Engines via Pivoted Query Synthesis
  • Scaling Automated Database System Testing cites Keep It Simple: Testing Databases via Differential Query Plans
  • Scaling Automated Database System Testing cites Constant Optimization Driven Database System Testing
  • Scaling Automated Database System Testing cites Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction
  • Scaling Automated Database System Testing cites Testing Database Engines via Pivoted Query Synthesis
  • Constant Optimization Driven Database System Testing cites Testing Database Engines via Pivoted Query Synthesis
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction cites Keep It Simple: Testing Databases via Differential Query Plans
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction cites Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction cites Testing Database Engines via Pivoted Query Synthesis
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction cites Keep It Simple: Testing Databases via Differential Query Plans
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction cites Testing Database Engines via Pivoted Query Synthesis
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites DeepDB: Learn from Data, not from Queries!
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites NeuroCard: One Cardinality Estimator for All Tables
  • NeuroCard: One Cardinality Estimator for All Tables cites Deep Unsupervised Cardinality Estimation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers14

  1. Keep It Simple: Testing Databases via Differential Query PlansJinsheng Ba, Manuel RiggerSIGMOD 2024 · 23 citations
  2. 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
  3. Constant Optimization Driven Database System TestingChi Zhang, Manuel RiggerSIGMOD 2025 · 8 citations
  4. Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database ConstructionJiansen Song, Wensheng Dou, Yingying Zheng, Yu Gao et al.VLDB 2025 · 6 citations
  5. Scaling Automated Database System TestingSuyang Zhong, Manuel RiggerASPLOS 2026 · 4 citations

Builds on17

  1. Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu et al.VLDB 2020 · 206 citations
  2. Cardinality Estimation in DBMS: A Comprehensive Benchmark EvaluationYuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu et al.VLDB 2022 · 169 citations
  3. DeepDB: Learn from Data, not from Queries!Benjamin Hilprecht, Andreas Schmidt, Moritz Kulessa, Alejandro Molina et al.VLDB 2020 · 154 citations
  4. Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 citations
  5. NeuroCard: One Cardinality Estimator for All TablesZongheng Yang, Amog Kamsetty, Sifei Luan, Eric Liang et al.VLDB 2021 · 138 citations

Related papers

  1. Detecting Join Bugs in Database Engines via Join Implication ReasoningZhaokun Xiang, Suyang Zhong, Manuel RiggerSIGMOD 2026
  2. A Set-Theoretic Approach to Detecting Logic Bugs in DBMS Inner Join OptimizationsCe Lyu, Changzheng Wei, Yanhao Wang, Jie Liang et al.ICDE 2026
  3. Testing Database Systems via Differential Query ExecutionJiansen Song, Wensheng Dou, Ziyu Cui, Qianwang Dai et al.ICSE 2023 · 26 citations
  4. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 citations
  5. SRS: Detecting Logic Bugs of Join Implementation in DBMSs via Set Relation SynthesisJinhui Lai, Chi Zhang, Bingyan Li, Chenglin Liang et al.SIGMOD 2026 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines