HLL_UNION_AGG

description

Syntax

HLL_UNION_AGG(hll)

HLL is an engineering implementation based on HyperLog algorithm, which is used to save the intermediate results of HyperLog calculation process.

It can only be used as the value column type of the table and reduce the amount of data through aggregation to achieve the purpose of speeding up the query.

Based on this, we get an estimate with an error of about 1%. The HLL column is generated by other columns or data imported into the data.

When importing, hll_hash function is used to specify which column in data is used to generate HLL column. It is often used to replace count distinct, and to calculate UV quickly in business by combining rollup.

example

  1. MySQL > select HLL_UNION_AGG(uv_set) from test_uv;;
  2. +-------------------------+
  3. THE COURT OF JUSTICE OF THE EUROPEAN COMMUNITIES,
  4. +-------------------------+
  5. | 17721 |
  6. +-------------------------+

keyword HLL_UNION_AGG,HLL,UNION,AGG