English

Zero-Cost NDV Estimation from Columnar File Metadata

Databases 2026-03-27 v1

Abstract

We present a method for estimating the number of distinct values (NDV) of a column in columnar file formats, using only existing file metadata--no extra storage, no data access. Two complementary signals are exploited: (1)~inverting the dictionary-encoded storage size equation yields accurate NDV estimates when distinct values are well-spread across row groups; (2)~counting distinct min/max values across row groups and inverting a coupon collector model provides robust estimates for sorted or partitioned data. A lightweight distribution detector routes between the two estimators. While demonstrated on Apache Parquet, the technique generalizes to any format with dictionary encoding and partition-level statistics, such as ORC and F3. Applications include cost-based query optimization, GPU memory allocation, and data profiling.

Cite

@article{arxiv.2603.24606,
  title  = {Zero-Cost NDV Estimation from Columnar File Metadata},
  author = {Claude Brisson},
  journal= {arXiv preprint arXiv:2603.24606},
  year   = {2026}
}

Comments

8 pages, no figure

R2 v1 2026-07-01T11:37:47.893Z