Skip to main content
Skip to main content

Overview

The aggregation data types store aggregation results or intermediate results during aggregation. They are used for accelerating aggregation-heavy queries.

  • BITMAP: It is used for exact deduplication, such as in (UV) statistics and audience segmentation. It works in conjunction with BITMAP functions like bitmap_union, bitmap_union_count, bitmap_hash, and bitmap_hash64.

  • HLL: It is used for approximate deduplication and provides better performance than COUNT DISTINCT. It works in conjunction with HLL functions like hll_union_agg, hll_raw_agg, hll_cardinality, and hll_hash.

  • QUANTILE_STATE: It is used for approximate percentile calculations and offers better performance than the PERCENTILE function. It works with functions like QUANTILE_PERCENT, QUANTILE_UNION, and TO_QUANTILE_STATE.

  • AGG_STATE: It is used to accelerate aggregations, utilized in combination with aggregation function combinators like state/merge/union.