Learning to be a Statistician: Learned Estimator for Number of Distinct Values

02/06/2022
by   Renzhi Wu, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/13/2022

On fitting the Lomax distribution: a comparison between minimum distance estimators and other estimation techniques

In this paper we investigate the performance of a variety of estimation ...
research
11/30/2018

Per-Flow Cardinality Estimation Based On Virtual LogLog Sketching

Flow cardinality estimation is the problem of estimating the number of d...
research
09/15/2022

Robust explicit estimation of the log-logistic distribution with applications

The parameters of the log-logistic distribution are generally estimated ...
research
07/30/2023

IWEK: An Interpretable What-If Estimator for Database Knobs

The knobs of modern database management systems have significant impact ...
research
09/02/2019

DeepDB: Learn from Data, not from Queries!

The typical approach for learned DBMS components is to capture the behav...
research
05/10/2019

Selectivity Estimation with Deep Likelihood Models

Selectivity estimation has long been grounded in statistical tools for d...
research
12/12/2020

Are We Ready For Learned Cardinality Estimation?

Cardinality estimation is a fundamental but long unresolved problem in q...

Please sign up or login with your details

Forgot password? Click here to reset