mlsanityData to 14 Oct 2026

Flow-Loss: Learning Cardinality Estimates That Matter

arXiv 2101.04964 ↗First posted 13 Jan 2021cs.DBcited by 22

Not on the map. Why?

Abstract (arXiv)

Previous approaches to learned cardinality estimation have focused on improving average estimation error, but not all estimates matter equally. Since learned models inevitably make mistakes, the goal should be to improve the estimates that make the biggest difference to an optimizer. We introduce a new loss function, Flow-Loss, that explicitly optimizes for better query plans by approximating the optimizer's cost model and dynamic programming search algorithm with analytical functions. At the heart of Flow-Loss is a reduction of query optimization to a flow routing problem on a certain plan graph in which paths correspond to different query plans. To evaluate our approach, we introduce the Cardinality Estimation Benchmark, which contains the ground truth cardinalities for sub-plans of over 16K queries from 21 templates with up to 15 joins. We show that across different architectures and databases, a model trained with Flow-Loss improves the cost of plans (using the PostgreSQL cost model) and query runtimes despite having worse estimation accuracy than a model trained with Q-Error. When the test set queries closely match the training queries, both models improve performance significantly over PostgreSQL and are close to the optimal performance (using true cardinalities). However, the Q-Error trained model degrades significantly when evaluated on queries that are slightly different (e.g., similar but not identical query templates), while the Flow-Loss trained model generalizes better to such situations. For example, the Flow-Loss model achieves up to 1.5x better runtimes on unseen templates compared to the Q-Error model, despite leveraging the same model architecture and training data.

Key facts. Cited by 22 papers in the map (data through 14 Oct 2026). First posted on arXiv 13 Jan 2021.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2021: 2; 2022: 2; 2023: 1; 2024: 8; 2025: 7; 2026: 2.

22 papers.

Sort:

By area:

  1. 2021Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluationcited by 30
  2. 2022FactorJoin: A New Cardinality Estimation Framework for Join Queriescited by 13
  3. 2021A Unified Transferable Model for ML-Enhanced DBMScited by 10
  4. 2024E2ETune: End-to-End Knob Tuning via Fine-tuned Generative Language Modelcited by 9
  5. 2024CardBench: A Benchmark for Learned Cardinality Estimation in Relational Databasescited by 4
  6. 2024The Unreasonable Effectiveness of LLMs for Query Optimizationcited by 4
  7. 2024Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution Learnabilitycited by 4
  8. 2023Kepler: Robust Learning for Faster Parametric Query Optimizationcited by 3
  9. 2024A Practical Theory of Generalization in Selectivity Learningcited by 3
  10. 2024HERO: Hint-Based Efficient and Reliable Query Optimizercited by 3
  11. 2025In-Context Adaptation to Concept Drift for Learned Database Operationscited by 3
  12. 2022Learned-Database Systems Securitycited by 2
10 more
  1. 2024Towards Establishing Guaranteed Error for Learned Database Operationscited by 2
  2. 2024Robust Plan Evaluation based on Approximate Probabilistic Machine Learningcited by 1
  3. 2025Large Scale Multi-Task Bayesian Optimization with Large Language Modelscited by 1
  4. 2025Data-Agnostic Cardinality Learning from Imperfect Workloadscited by 1
  5. 2026When Does q-error Predict Plan Regret? Three Regimes of Cardinality-Estimation Errorcited by 1
  6. 2025Reqo: A Comprehensive Learning-Based Cost Model for Robust and Explainable Query Optimizationcited by 0
  7. 2025Low Rank Learning for Offline Query Optimizationcited by 0
  8. 2025ZeroCard: Cardinality Estimation with Zero Dependence on Target Databases -- No Data, No Query, No Retrainingcited by 0
  9. 2025CoLSE: A Lightweight and Robust Hybrid Learned Model for Single-Table Cardinality Estimation using Joint CDFcited by 0
  10. 2026Fully Inductive Cardinality Estimationcited by 0