Skip to main content
Since 1.3.0 Estimate the number of distinct values from a hyperloglog

Samples

Estimate the number of distinct values from a hyperloglog named hyperloglog. The expected output is 98,814.
SELECT distinct_count(hyperloglog(8192, data))
  FROM generate_series(1, 100000) data
Output:
distinct_count
----------------
        98814

Arguments

NameTypeDefaultRequiredDescription
hyperloglogHyperloglog-The hyperloglog to extract the count from.

Returns

The number of distinct elements counted by the hyperloglog.