stderror()

The stderror function returns an estimate of the relative standard error of the hyperloglog, based on the hyperloglog error formula. Approximate results are:

precisionregisterserrorbytes
4160.260012
5320.183824
6640.130048
71280.091996
82560.0650192
95120.0460384
1010240.0325768
1120480.0230
1240960.01633072
1381920.01156144
14163840.008112288
15327680.005724576
16655360.004149152
171310720.002998304
182621440.0020196608

For more information about approximate count distinct functions, see the hyperfunctions documentation.

Required Arguments

NameTypeDescription
hyperloglogHyperloglogThe hyperloglog to extract the count from.

Returns

ColumnTypeDescription
stderrorBIGINTThe number of distinct elements counted by the hyperloglog.

Sample Usage

This examples retrieves the standard error from a hyperloglog called hyperloglog:

SELECT stderror(hyperloglog(64, data))
FROM generate_series(1, 100) data

 stderror
----------
     0.13

Found an issue on this page?

Report an issue!

Related Content