> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> HyperLogLog 알고리즘을 사용해 서로 다른 인수 값의 대략적인 개수를 계산합니다.

# uniqHLL12

<div id="uniqHLL12">
  ## uniqHLL12
</div>

도입 버전: v1.1.0

[HyperLogLog](https://en.wikipedia.org/wiki/HyperLogLog) 알고리즘을 사용하여 서로 다른 인수 값의 대략적인 개수를 계산합니다.

<Warning>
  이 함수는 사용을 권장하지 않습니다. 대부분의 경우 [uniq](/ko/reference/functions/aggregate-functions/uniq) 또는 [uniqCombined](/ko/reference/functions/aggregate-functions/uniqCombined) 함수를 사용하십시오.
</Warning>

<Accordion title="구현 세부 정보">
  이 함수는 집계의 모든 매개변수에 대해 해시를 계산한 다음, 이를 계산에 사용합니다.
  HyperLogLog 알고리즘을 사용해 서로 다른 인수 값의 개수를 근사합니다.

  2^12개의 5비트 셀을 사용합니다.
  상태 크기는 2.5 KB를 약간 초과합니다.
  작은 데이터 세트(\<10K 요소)에서는 결과가 그다지 정확하지 않습니다(오류는 최대 약 10%).
  하지만 카디널리티가 높은 데이터 세트(10K-100M)에서는 결과가 상당히 정확하며, 최대 오류는 약 1.6%입니다.
  100M부터는 추정 오류가 증가하며, 카디널리티가 매우 높은 데이터 세트(1B+ 요소)에서는 함수가 매우 부정확한 결과를 반환합니다.

  결정적인 결과를 제공합니다(쿼리 처리 순서에 영향을 받지 않음).
</Accordion>

**구문**

```sql theme={null}
uniqHLL12(x[, ...])
```

**인수**

* `x` — 이 함수는 가변 개수의 인수를 받습니다. [`Tuple(T)`](/ko/reference/data-types/tuple) 또는 [`Array(T)`](/ko/reference/data-types/array) 또는 [`Date`](/ko/reference/data-types/date) 또는 [`DateTime`](/ko/reference/data-types/datetime) 또는 [`String`](/ko/reference/data-types/string) 또는 [`(U)Int*`](/ko/reference/data-types/int-uint) 또는 [`Float*`](/ko/reference/data-types/float) 또는 [`Decimal`](/ko/reference/data-types/decimal)

**반환 값**

서로 다른 인수 값의 대략적인 개수를 나타내는 UInt64 타입의 숫자를 반환합니다. [`UInt64`](/ko/reference/data-types/int-uint)

**예시**

**기본 사용법**

```sql title=Query theme={null}
CREATE TABLE example_hll
(
    id UInt32,
    category String
)
ENGINE = Memory;

INSERT INTO example_hll VALUES
(1, 'A'), (2, 'B'), (3, 'A'), (4, 'C'), (5, 'B'), (6, 'A');

SELECT uniqHLL12(category) AS hll_unique_categories
FROM example_hll;
```

```response title=Response theme={null}
┌─hll_unique_categories─┐
│                     3 │
└───────────────────────┘
```

**관련 항목**

* [uniq](/ko/reference/functions/aggregate-functions/uniq)
* [uniqCombined](/ko/reference/functions/aggregate-functions/uniqCombined)
* [uniqExact](/ko/reference/functions/aggregate-functions/uniqExact)
* [uniqTheta](/ko/reference/functions/aggregate-functions/uniqthetasketch)
