Versions:
rollup() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Toolkit
TimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
rollup(
log hyperloglog
) RETURNS Hyperloglog
Returns a hyperloglog by aggregating over the union of the input elements.
For more information about approximate count distinct functions, see the hyperfunctions documentation.
Required arguments
Name | Type | Description |
---|---|---|
log | Hyperloglog | Column of Hyperloglogs to be united. |
Returns
Column | Type | Description |
---|---|---|
hyperloglog | Hyperloglog | A hyperloglog containing the count of the union of the input hyperloglogs. |
Sample usage
SELECT distinct_count(rollup(logs))
FROM (
(SELECT hyperloglog(32, v::text) logs FROM generate_series(1, 100) v)
UNION ALL
(SELECT hyperloglog(32, v::text) FROM generate_series(50, 150) v)
) hll;
count
-------
152
Found an issue on this page?
Report an issue!