Lune

SIGMOD2023Top-tier venue

SafeBound: A Practical System for Generating Cardinality Bounds

Kyle B. Deeds, Dan Suciu, Magdalena Balazinska

Abstract

Recent work has reemphasized the importance of cardinality estimates for query optimization. While new techniques have continuously improved in accuracy over time, they still generally allow for under-estimates which often lead optimizers to make overly optimistic decisions. This can be very costly for expensive queries. An alternative approach to estimation is cardinality bounding, also called pessimistic cardinality estimation, where the cardinality estimator provides guaranteed upper bounds of the true cardinality. By never underestimating, this approach allows the optimizer to avoid potentially inefficient plans. However, existing pessimistic cardinality estimators are not yet practical: they use very limited statistics on the data, and cannot handle predicates. In this paper, we introduce SafeBound, the first practical system for generating cardinality bounds. SafeBound builds on a recent theoretical work that uses degree sequences on join attributes to compute cardinality bounds, extends this framework with predicates, introduces a practical compression method for the degree sequences, and implements an efficient inference algorithm. Across four workloads, SafeBound achieves up to 80% lower end-to-end runtimes than PostgreSQL, and is on par or better than state of the art ML-based estimators and pessimistic cardinality estimators, by improving the runtime of the expensive queries. It also saves up to 500x in query planning time, and uses up to 6.8x less space compared to state of the art cardinality estimation methods.

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.

4 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

  • Are We Ready For Learned Cardinality Estimation? cites NeuroCard: One Cardinality Estimator for All Tables
  • Path-centric Cardinality Estimation for Subgraph Matching cites Are We Ready For Learned Cardinality Estimation?
  • Path-centric Cardinality Estimation for Subgraph Matching cites COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality Estimation
  • Path-centric Cardinality Estimation for Subgraph Matching cites Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
  • LpBound: Pessimistic Cardinality Estimation Using ℓp-Norms of Degree Sequences cites Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
  • LpBound: Pessimistic Cardinality Estimation Using ℓp-Norms of Degree Sequences cites NeuroCard: One Cardinality Estimator for All Tables
  • COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality Estimation cites Are We Ready For Learned Cardinality Estimation?
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites Are We Ready For Learned Cardinality Estimation?
  • 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
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. LpBound: Pessimistic Cardinality Estimation Using ℓp-Norms of Degree SequencesHaozhe Zhang, Christoph Mayer, Mahmoud Abo Khamis, Dan Olteanu et al.SIGMOD 2025 · 7 citations
  2. COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality EstimationKyle B. Deeds, Diandre Sabale, Moe Kayali, Dan SuciuVLDB 2025 · 4 citations
  3. Galley: Modern Query Optimization for Sparse Tensor ProgramsKyle Deeds, Willow Ahrens, Magdalena Balazinska, Dan SuciuSIGMOD 2025 · 3 citations
  4. Path-centric Cardinality Estimation for Subgraph MatchingZhengdong Wang, Qiang Yin, Longbin LaiVLDB 2025 · 1 citation

Builds on13

  1. The PGM-index: a fully-dynamic compressed learned index with provable worst-case boundsPaolo Ferragina, Giorgio VinciguerraVLDB 2020 · 178 citations
  2. Cardinality Estimation in DBMS: A Comprehensive Benchmark EvaluationYuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu et al.VLDB 2022 · 169 citations
  3. Are We Ready For Learned Cardinality Estimation?Xiaoying Wang, Changbo Qu, Weiyuan Wu, Jiannan Wang et al.VLDB 2021 · 156 citations
  4. DeepDB: Learn from Data, not from Queries!Benjamin Hilprecht, Andreas Schmidt, Moritz Kulessa, Alejandro Molina et al.VLDB 2020 · 154 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. CorrBound: Cardinality Estimation Accounting for Inter- and Intra-relation CorrelationsChristoph Mayer, Haozhe Zhang, Mahmoud Abo Khamis, Kyle Deeds et al.SIGMOD 2026
  2. Speeding Up End-to-end Query Execution via Learning-based Progressive Cardinality EstimationFang Wang, Xiao Yan, Man Lung Yiu, Shuai Li et al.SIGMOD 2023 · 24 citations
  3. Sample-Efficient Cardinality Estimation Using Geometric Deep LearningSilvan Reiner, Michael GrossniklausVLDB 2024 · 20 citations
  4. Prediction Intervals for Learned Cardinality Estimation: An Experimental EvaluationSaravanan Thirumuruganathan, Suraj Shetiya, Nick Koudas, Gautam DasICDE 2022 · 7 citations
  5. FLAT: Fast, Lightweight and Accurate Method for Cardinality EstimationRong Zhu, Ziniu Wu, Yuxing Han, Kai Zeng et al.VLDB 2021 · 120 citations
Dusk over the sea between two cliffs drawn in fine vertical lines