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

The syntax is:
distinct_count(
    hyperloglog Hyperloglog
) RETURNS BIGINT
NameTypeDefaultRequiredDescription
hyperloglogHyperloglog-The hyperloglog to extract the count from.

Returns

ColumnTypeDescription
distinct_countBIGINTThe number of distinct elements counted by the hyperloglog.