Learning to be a Statistician: Learned Estimator for Number of Distinct Values
Not on the map. Why?
Abstract (arXiv)
Estimating the number of distinct values (NDV) in a column is useful for many tasks in database systems, such as columnstore compression and data profiling. In this work, we focus on how to derive accurate NDV estimations from random (online/offline) samples. Such efficient estimation is critical for tasks where it is prohibitive to scan the data even once. Existing sample-based estimators typically rely on heuristics or assumptions and do not have robust performance across different datasets as the assumptions on data can easily break. On the other hand, deriving an estimator from a principled formulation such as maximum likelihood estimation is very challenging due to the complex structure of the formulation. We propose to formulate the NDV estimation task in a supervised learning framework, and aim to learn a model as the estimator. To this end, we need to answer several questions: i) how to make the learned model workload agnostic; ii) how to obtain training data; iii) how to perform model training. We derive conditions of the learning framework under which the learned model is workload agnostic, in the sense that the model/estimator can be trained with synthetically generated training data, and then deployed into any data warehouse simply as, e.g., user-defined functions (UDFs), to offer efficient (within microseconds on CPU) and accurate NDV estimations for unseen tables and workloads. We compare the learned estimator with the state-of-the-art sample-based estimators on nine real-world datasets to demonstrate its superior estimation accuracy. We publish our code for training data generation, model training, and the learned estimator online for reproducibility.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 12 of its 52 references that are in the map. First posted on arXiv 6 Feb 2022.
Builds on
12 of 52 references.
References · 12
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2015Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shiftcited by 6,979
- 2016On the Expressive Power of Deep Neural Networkscited by 302
- 2020How Neural Networks Extrapolate: From Feedforward to Graph Neural Networkscited by 218
- 2017L2 Regularization versus Batch and Weight Normalizationcited by 121
- 2018Learned Cardinalities: Estimating Correlated Joins with Deep Learningcited by 64
- 2020FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimationcited by 22
- 2020Are We Ready For Learned Cardinality Estimation?cited by 19
- 2019Efficient Profile Maximum Likelihood for Universal Symmetric Property Estimationcited by 5
- 2019The Broad Optimality of Profile Maximum Likelihoodcited by 5
- 2017Approximate Profile Maximum Likelihoodcited by 4
- 2019Cardinality Estimation in a Virtualized Network Device Using Online Machine Learningcited by 2
Built on by
Citing papers per year: 2022: 2; 2023: 0; 2024: 0; 2025: 2.
4 papers.
- 2022Learning Hyper Label Model for Programmatic Weak Supervisioncited by 16
- 2022Ground Truth Inference for Weakly Supervised Entity Matchingcited by 5
- 2025Meta-Statistical Learning: Supervised Learning of Statistical Estimatorscited by 1
- 2025PLM4NDV: Minimizing Data Access for Number of Distinct Values Estimation with Pre-trained Language Modelscited by 0
- 2025PLM4NDV: Minimizing Data Access for Number of Distinct Values Estimation with Pre-trained Language Models1 Apr 2025
- 2025Meta-Statistical Learning: Supervised Learning of Statistical Estimators17 Feb 2025
- 2022Ground Truth Inference for Weakly Supervised Entity Matching13 Nov 2022
- 2022Learning Hyper Label Model for Programmatic Weak Supervision27 Jul 2022