Skip to content

stderror()

Estimate the relative standard error of a hyperloglog

Since 1.3.0

Estimate the relative standard error of a Hyperloglog. For approximate relative errors by number of buckets, see the relative errors section.

Estimate the relative standard error of a hyperloglog named hyperloglog. The expected output is 0.011490485194281396.

SELECT stderror(hyperloglog(8192, data))
FROM generate_series(1, 100000) data

Output:

stderror
----------------------
0.011490485194281396

The syntax is:

stderror(
hyperloglog Hyperloglog
) RETURNS DOUBLE PRECISION
NameTypeDefaultRequiredDescription
hyperloglogHyperloglog-The hyperloglog to estimate the error of.
ColumnTypeDescription
stderrorDOUBLE PRECISIONThe approximate relative standard error of the hyperloglog.