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
, andbitmap_hash64
.HLL: It is used for approximate deduplication and provides better performance than
COUNT DISTINCT
. It works in conjunction with HLL functions likehll_union_agg
,hll_raw_agg
,hll_cardinality
, andhll_hash
.QUANTILE_STATE: It is used for approximate percentile calculations and offers better performance than the
PERCENTILE
function. It works with functions likeQUANTILE_PERCENT
,QUANTILE_UNION
, andTO_QUANTILE_STATE
.AGG_STATE: It is used to accelerate aggregations, utilized in combination with aggregation function combinators like state/merge/union.