{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,24]],"date-time":"2026-07-24T14:33:29Z","timestamp":1784903609857,"version":"3.55.0"},"reference-count":60,"publisher":"Association for Computing Machinery (ACM)","issue":"2","content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. VLDB Endow."],"published-print":{"date-parts":[[2021,10]]},"abstract":"<jats:p>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<jats:italic>workload agnostic<\/jats:italic>, in the sense that the model\/estimator can be trained with synthetically generated training data, and then deployed into any data warehouse simply as,<jats:italic>e.g.<\/jats:italic>, user-defined functions (UDFs), to offer efficient (within microseconds on CPU) and accurate NDV estimations for<jats:italic>unseen tables and workloads.<\/jats:italic>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.<\/jats:p>","DOI":"10.14778\/3489496.3489508","type":"journal-article","created":{"date-parts":[[2022,2,5]],"date-time":"2022-02-05T00:28:36Z","timestamp":1644020916000},"page":"272-284","source":"Crossref","is-referenced-by-count":16,"title":["Learning to be a statistician"],"prefix":"10.14778","volume":"15","author":[{"given":"Renzhi","family":"Wu","sequence":"first","affiliation":[{"name":"Georgia Institute of Technology"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Bolin","family":"Ding","sequence":"additional","affiliation":[{"name":"Alibaba Group"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Xu","family":"Chu","sequence":"additional","affiliation":[{"name":"Georgia Institute of Technology"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Zhewei","family":"Wei","sequence":"additional","affiliation":[{"name":"Renmin University of China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Xiening","family":"Dai","sequence":"additional","affiliation":[{"name":"Alibaba Group"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Tao","family":"Guan","sequence":"additional","affiliation":[{"name":"Alibaba Group"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jingren","family":"Zhou","sequence":"additional","affiliation":[{"name":"Alibaba Group"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2022,2,4]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"2020. Airlines Departure Delay. https:\/\/www.openml.org\/d\/42728 2020. Airlines Departure Delay. https:\/\/www.openml.org\/d\/42728"},{"key":"e_1_2_1_2_1","unstructured":"2020. Box plot. https:\/\/en.wikipedia.org\/wiki\/Box_plot 2020. Box plot. https:\/\/en.wikipedia.org\/wiki\/Box_plot"},{"key":"e_1_2_1_3_1","unstructured":"2020. Bureau of Transportation Statistics. https:\/\/www.transtats.bts.gov\/ 2020. Bureau of Transportation Statistics. https:\/\/www.transtats.bts.gov\/"},{"key":"e_1_2_1_4_1","unstructured":"2020. Campaign finance data. https:\/\/www.fec.gov\/data\/ 2020. Campaign finance data. https:\/\/www.fec.gov\/data\/"},{"key":"e_1_2_1_5_1","unstructured":"2020. Department of Motor Vehicle (DMV) Office Locations. https:\/\/catalog.data.gov\/dataset\/department-of-motor-vehicle-dmv-office-locations 2020. Department of Motor Vehicle (DMV) Office Locations. https:\/\/catalog.data.gov\/dataset\/department-of-motor-vehicle-dmv-office-locations"},{"key":"e_1_2_1_6_1","unstructured":"2020. Leaky ReLU. https:\/\/pytorch.org\/docs\/stable\/generated\/torch.nn.LeakyReLU.html 2020. Leaky ReLU. https:\/\/pytorch.org\/docs\/stable\/generated\/torch.nn.LeakyReLU.html"},{"key":"e_1_2_1_7_1","unstructured":"2020. MaxCompute. https:\/\/www.alibabacloud.com\/product\/maxcompute 2020. MaxCompute. https:\/\/www.alibabacloud.com\/product\/maxcompute"},{"key":"e_1_2_1_8_1","unstructured":"2020. Pydistinct - Population Distinct Value Estimators. https:\/\/pydistinct.readthedocs.io\/ 2020. Pydistinct - Population Distinct Value Estimators. https:\/\/pydistinct.readthedocs.io\/"},{"key":"e_1_2_1_9_1","unstructured":"2020. Random numbers that add to 100: Matlab. https:\/\/stackoverflow.com\/questions\/8064629\/random-numbers-that-add-to-100-matlab 2020. Random numbers that add to 100: Matlab. https:\/\/stackoverflow.com\/questions\/8064629\/random-numbers-that-add-to-100-matlab"},{"key":"e_1_2_1_10_1","unstructured":"2020. scipy.optimize.brentq. https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.brentq.html 2020. scipy.optimize.brentq. https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.brentq.html"},{"key":"e_1_2_1_11_1","unstructured":"2020. skorch documentation. https:\/\/skorch.readthedocs.io\/en\/stable\/ 2020. skorch documentation. https:\/\/skorch.readthedocs.io\/en\/stable\/"},{"key":"e_1_2_1_12_1","unstructured":"2020. Voter Registration Statistics. https:\/\/www.ncsbe.gov\/results-data\/voter-registration-data 2020. Voter Registration Statistics. https:\/\/www.ncsbe.gov\/results-data\/voter-registration-data"},{"key":"e_1_2_1_13_1","unstructured":"2020. weight decay in neural networks. https:\/\/metacademy.org\/graphs\/concepts\/weight_decay_neural_networks 2020. weight decay in neural networks. https:\/\/metacademy.org\/graphs\/concepts\/weight_decay_neural_networks"},{"key":"e_1_2_1_14_1","volume-title":"Random Vectors with Fixed Sum - File Exchange - MATLAB Central. https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/9700-random-vectors-with-fixed-sum [Online","year":"2021","unstructured":"2021. Random Vectors with Fixed Sum - File Exchange - MATLAB Central. https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/9700-random-vectors-with-fixed-sum [Online ; accessed 27. Apr. 2021 ]. 2021. Random Vectors with Fixed Sum - File Exchange - MATLAB Central. https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/9700-random-vectors-with-fixed-sum [Online; accessed 27. Apr. 2021]."},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1109\/BigData.2015.7363736"},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.5555\/1162264"},{"key":"e_1_2_1_17_1","unstructured":"Richard P Brent. 1973. Algorithms for Minimization without Derivatives chap. 4. Richard P Brent. 1973. Algorithms for Minimization without Derivatives chap. 4."},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1080\/01621459.1993.10594330"},{"key":"e_1_2_1_19_1","volume-title":"Maximum likelihood estimation for sample surveys","author":"Chambers Raymond L","unstructured":"Raymond L Chambers , David G Steel , Suojin Wang , and Alan Welsh . 2012. Maximum likelihood estimation for sample surveys . CRC Press . Raymond L Chambers, David G Steel, Suojin Wang, and Alan Welsh. 2012. Maximum likelihood estimation for sample surveys. CRC Press."},{"key":"e_1_2_1_20_1","volume-title":"Nonparametric estimation of the number of classes in a population. Scandinavian Journal of statistics","author":"Chao Anne","year":"1984","unstructured":"Anne Chao . 1984. Nonparametric estimation of the number of classes in a population. Scandinavian Journal of statistics ( 1984 ), 265--270. Anne Chao. 1984. Nonparametric estimation of the number of classes in a population. Scandinavian Journal of statistics (1984), 265--270."},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.1080\/01621459.1992.10475194"},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/335168.335230"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/3313276.3316398"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/3035918.3056097"},{"key":"e_1_2_1_25_1","doi-asserted-by":"publisher","DOI":"10.1109\/TNET.2019.2940705"},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.14778\/3407790.3407820"},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.14778\/3329772.3329780"},{"key":"e_1_2_1_28_1","doi-asserted-by":"publisher","DOI":"10.46298\/dmtcs.3545"},{"key":"e_1_2_1_29_1","volume-title":"Deep learning Ch. 5 Machine Learning Basics","author":"Goodfellow Ian","unstructured":"Ian Goodfellow , Yoshua Bengio , and Aaron Courville . 2017. Deep learning Ch. 5 Machine Learning Basics . The MIT Press , 132--133. Ian Goodfellow, Yoshua Bengio, and Aaron Courville. 2017. Deep learning Ch. 5 Machine Learning Basics. The MIT Press, 132--133."},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.5555\/645921.673295"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1080\/01621459.1998.10473807"},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.5555\/3454287.3455273"},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3186728.3164145"},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.5555\/521706"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.14778\/3384345.3384349"},{"key":"e_1_2_1_36_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICNN.1996.549076"},{"key":"e_1_2_1_37_1","doi-asserted-by":"publisher","DOI":"10.5555\/3045118.3045167"},{"key":"e_1_2_1_38_1","unstructured":"Piotr Juszczak D Tax and Robert PW Duin. [n.d.]. Feature scaling in support vector data description. Citeseer. Piotr Juszczak D Tax and Robert PW Duin. [n.d.]. Feature scaling in support vector data description. Citeseer."},{"key":"e_1_2_1_39_1","doi-asserted-by":"publisher","DOI":"10.14778\/3151106.3151112"},{"key":"e_1_2_1_40_1","volume-title":"Kingma and Jimmy Ba","author":"Diederik","year":"2015","unstructured":"Diederik P. Kingma and Jimmy Ba . 2015 . Adam : A Method for Stochastic Optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7--9, 2015, Conference Track Proceedings, Yoshua Bengio and Yann LeCun (Eds .). http:\/\/arxiv.org\/abs\/1412.6980 Diederik P. Kingma and Jimmy Ba. 2015. Adam: A Method for Stochastic Optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7--9, 2015, Conference Track Proceedings, Yoshua Bengio and Yann LeCun (Eds.). http:\/\/arxiv.org\/abs\/1412.6980"},{"key":"e_1_2_1_41_1","volume-title":"Learned cardinalities: Estimating correlated joins with deep learning. arXiv preprint arXiv:1809.00677","author":"Kipf Andreas","year":"2018","unstructured":"Andreas Kipf , Thomas Kipf , Bernhard Radke , Viktor Leis , Peter Boncz , and Alfons Kemper . 2018. Learned cardinalities: Estimating correlated joins with deep learning. arXiv preprint arXiv:1809.00677 ( 2018 ). Andreas Kipf, Thomas Kipf, Bernhard Radke, Viktor Leis, Peter Boncz, and Alfons Kemper. 2018. Learned cardinalities: Estimating correlated joins with deep learning. arXiv preprint arXiv:1809.00677 (2018)."},{"key":"e_1_2_1_42_1","doi-asserted-by":"publisher","DOI":"10.5555\/645924.671200"},{"key":"e_1_2_1_43_1","volume-title":"An learned sample-based NDV estimator. https:\/\/github.com\/wurenzhi\/learned_ndv_estimator. [Online","year":"2021","unstructured":"Library. 2021. An learned sample-based NDV estimator. https:\/\/github.com\/wurenzhi\/learned_ndv_estimator. [Online ; accessed 11- October - 2021 ]. Library. 2021. An learned sample-based NDV estimator. https:\/\/github.com\/wurenzhi\/learned_ndv_estimator. [Online; accessed 11-October-2021]."},{"key":"e_1_2_1_44_1","doi-asserted-by":"publisher","DOI":"10.5555\/2886444.2886453"},{"key":"e_1_2_1_45_1","doi-asserted-by":"publisher","DOI":"10.1145\/1353343.1353418"},{"key":"e_1_2_1_46_1","doi-asserted-by":"crossref","first-page":"1324","DOI":"10.1093\/bioinformatics\/btw832","article-title":"ntCard: a streaming algorithm for cardinality estimation in genomics data","volume":"33","author":"Mohamadi Hamid","year":"2017","unstructured":"Hamid Mohamadi , Hamza Khan , and Inanc Birol . 2017 . ntCard: a streaming algorithm for cardinality estimation in genomics data . Bioinformatics 33 , 9 (2017), 1324 -- 1330 . Hamid Mohamadi, Hamza Khan, and Inanc Birol. 2017. ntCard: a streaming algorithm for cardinality estimation in genomics data. Bioinformatics 33, 9 (2017), 1324--1330.","journal-title":"Bioinformatics"},{"key":"e_1_2_1_47_1","doi-asserted-by":"publisher","DOI":"10.5555\/2791122.2791129"},{"key":"e_1_2_1_48_1","doi-asserted-by":"publisher","DOI":"10.1145\/1340771.1340773"},{"key":"e_1_2_1_49_1","unstructured":"Patrick E O'Neil Elizabeth J O'Neil and Xuedong Chen. 2007. The star schema benchmark (SSB). Patrick E O'Neil Elizabeth J O'Neil and Xuedong Chen. 2007. The star schema benchmark (SSB)."},{"key":"e_1_2_1_50_1","first-page":"1","article-title":"Approximate Profile Maximum Likelihood","volume":"20","author":"Pavlichin Dmitri S","year":"2019","unstructured":"Dmitri S Pavlichin , Jiantao Jiao , and Tsachy Weissman . 2019 . Approximate Profile Maximum Likelihood . Journal of Machine Learning Research 20 , 122 (2019), 1 -- 55 . http:\/\/jmlr.org\/papers\/v20\/18-075.html Dmitri S Pavlichin, Jiantao Jiao, and Tsachy Weissman. 2019. Approximate Profile Maximum Likelihood. Journal of Machine Learning Research 20, 122 (2019), 1--55. http:\/\/jmlr.org\/papers\/v20\/18-075.html","journal-title":"Journal of Machine Learning Research"},{"key":"e_1_2_1_51_1","doi-asserted-by":"publisher","DOI":"10.5555\/3305890.3305975"},{"key":"e_1_2_1_52_1","first-page":"97","article-title":"On estimation of the size of the dictionary of a long text on the basis of a sample","volume":"19","author":"Shlosser A","year":"1981","unstructured":"A Shlosser . 1981 . On estimation of the size of the dictionary of a long text on the basis of a sample . Engineering Cybernetics 19 , 1 (1981), 97 -- 102 . A Shlosser. 1981. On estimation of the size of the dictionary of a long text on the basis of a sample. Engineering Cybernetics 19, 1 (1981), 97--102.","journal-title":"Engineering Cybernetics"},{"key":"e_1_2_1_53_1","doi-asserted-by":"publisher","DOI":"10.1186\/s40537-019-0197-0"},{"key":"e_1_2_1_54_1","doi-asserted-by":"publisher","DOI":"10.1145\/3077136.3080713"},{"key":"e_1_2_1_55_1","doi-asserted-by":"publisher","DOI":"10.1145\/3299869.3319897"},{"key":"e_1_2_1_56_1","volume-title":"L2 regularization versus batch and weight normalization. arXiv preprint arXiv:1706.05350","author":"Laarhoven Twan Van","year":"2017","unstructured":"Twan Van Laarhoven . 2017. L2 regularization versus batch and weight normalization. arXiv preprint arXiv:1706.05350 ( 2017 ). Twan Van Laarhoven. 2017. L2 regularization versus batch and weight normalization. arXiv preprint arXiv:1706.05350 (2017)."},{"key":"e_1_2_1_57_1","doi-asserted-by":"publisher","DOI":"10.14778\/3461535.3461552"},{"key":"e_1_2_1_58_1","volume-title":"An learned sample-based NDV estimator (technical report). https:\/\/figshare.com\/s\/8cd5f3dad9418b84b75a. [Online","author":"Wu Renzhi","year":"2021","unstructured":"Renzhi Wu , Bolin Ding , Xu Chu , Zhewei Wei , Xiening Dai , Tao Guan , and JingrenZhou. 2021. An learned sample-based NDV estimator (technical report). https:\/\/figshare.com\/s\/8cd5f3dad9418b84b75a. [Online ; accessed 11- October - 2021 ]. Renzhi Wu, Bolin Ding, Xu Chu, Zhewei Wei, Xiening Dai, Tao Guan, and JingrenZhou. 2021. An learned sample-based NDV estimator (technical report). https:\/\/figshare.com\/s\/8cd5f3dad9418b84b75a. [Online; accessed 11-October-2021]."},{"key":"e_1_2_1_59_1","unstructured":"Keyulu Xu Mozhi Zhang Jingling Li Simon S Du Ken-ichi Kawarabayashi and Stefanie Jegelka. 2021. How neural networks extrapolate: From feedforward to graph neural networks. In ICLR. Keyulu Xu Mozhi Zhang Jingling Li Simon S Du Ken-ichi Kawarabayashi and Stefanie Jegelka. 2021. How neural networks extrapolate: From feedforward to graph neural networks. In ICLR."},{"key":"e_1_2_1_60_1","doi-asserted-by":"publisher","DOI":"10.14778\/3461535.3461539"}],"container-title":["Proceedings of the VLDB Endowment"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.14778\/3489496.3489508","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2023,11,17]],"date-time":"2023-11-17T00:11:23Z","timestamp":1700179883000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.14778\/3489496.3489508"}},"subtitle":["learned estimator for number of distinct values"],"short-title":[],"issued":{"date-parts":[[2021,10]]},"references-count":60,"journal-issue":{"issue":"2","published-print":{"date-parts":[[2021,10]]}},"alternative-id":["10.14778\/3489496.3489508"],"URL":"https:\/\/doi.org\/10.14778\/3489496.3489508","relation":{},"ISSN":["2150-8097"],"issn-type":[{"value":"2150-8097","type":"print"}],"subject":[],"published":{"date-parts":[[2021,10]]}}}