Lune

ICSE2024顶会

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

Jinsheng Ba, Manuel Rigger

摘要

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.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • Keep It Simple: Testing Databases via Differential Query Plans 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Scaling Automated Database System Testing 引用了 Keep It Simple: Testing Databases via Differential Query Plans
  • Scaling Automated Database System Testing 引用了 Constant Optimization Driven Database System Testing
  • 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
  • Constant Optimization Driven Database System Testing 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database Construction 引用了 Keep It Simple: Testing Databases via Differential Query Plans
  • 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 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction 引用了 Keep It Simple: Testing Databases via Differential Query Plans
  • Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database Construction 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation 引用了 DeepDB: Learn from Data, not from Queries!
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation 引用了 NeuroCard: One Cardinality Estimator for All Tables
  • NeuroCard: One Cardinality Estimator for All Tables 引用了 Deep Unsupervised Cardinality Estimation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper14

  1. Keep It Simple: Testing Databases via Differential Query PlansJinsheng Ba, Manuel RiggerSIGMOD 2024 · 23 次引用
  2. Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database ConstructionJiansen Song, Wensheng Dou, Yu Gao, Ziyu Cui 等VLDB 2024 · 13 次引用
  3. Constant Optimization Driven Database System TestingChi Zhang, Manuel RiggerSIGMOD 2025 · 8 次引用
  4. Detecting Schema-Related Logic Bugs in Relational DBMSs via Equivalent Database ConstructionJiansen Song, Wensheng Dou, Yingying Zheng, Yu Gao 等VLDB 2025 · 6 次引用
  5. Scaling Automated Database System TestingSuyang Zhong, Manuel RiggerASPLOS 2026 · 4 次引用

它引用的 Paper17

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

相关 Paper

  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 等ICDE 2026
  3. Testing Database Systems via Differential Query ExecutionJiansen Song, Wensheng Dou, Ziyu Cui, Qianwang Dai 等ICSE 2023 · 26 次引用
  4. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 次引用
  5. SRS: Detecting Logic Bugs of Join Implementation in DBMSs via Set Relation SynthesisJinhui Lai, Chi Zhang, Bingyan Li, Chenglin Liang 等SIGMOD 2026 · 4 次引用
黄昏的海面,两侧是细线勾勒的悬崖