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

> 컬럼 통계 조작에 대한 문서

# 컬럼 통계 조작

export const CloudNotSupportedBadge = () => {
  return <div className="cloudNotSupportedBadge">
            <div className="cloudNotSupportedIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.5" d="M6.33366 12.6666L12.3739 12.6667C13.6593 12.6667 14.7073 11.6187 14.7073 10.3334C14.7073 9.04804 13.6593 8.00003 12.3739 8.00003C12.3739 8.00003 12.3337 7.66659 12.0003 7.33325M10.667 5.33322C8.00033 2.33325 4.45395 4.78537 4.14195 6.68203C2.55728 6.7627 1.29395 8.06203 1.29395 9.6667C1.29395 11.3234 2.66699 12.6666 4.00033 12.6666" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.5" d="M2.66699 14L12.0003 4.66663" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>

        </div>
            ClickHouse Cloud에서 지원되지 않음
        </div>;
};

다음 작업을 사용할 수 있습니다:

* `ALTER TABLE [db].table ADD STATISTICS [IF NOT EXISTS] (column list) TYPE (type list)` - 테이블 메타데이터에 통계 설명을 추가합니다.

* `ALTER TABLE [db].table MODIFY STATISTICS (column list) TYPE (type list)` - 테이블 메타데이터의 통계 설명을 수정합니다.

* `ALTER TABLE [db].table DROP STATISTICS [IF EXISTS] (column list)` - 지정된 컬럼의 메타데이터에서 통계를 제거하고, 해당 컬럼에 대한 모든 파트의 통계 객체를 모두 삭제합니다.

* `ALTER TABLE [db].table CLEAR STATISTICS [IF EXISTS] (column list)` - 지정된 컬럼에 대한 모든 파트의 통계 객체를 모두 삭제합니다. 통계 객체는 `ALTER TABLE MATERIALIZE STATISTICS`를 사용하여 다시 빌드할 수 있습니다.

* `ALTER TABLE [db.]table MATERIALIZE STATISTICS (ALL | [IF EXISTS] (column list))` - 컬럼의 통계를 다시 빌드합니다. [뮤테이션](/ko/reference/statements/alter/index#mutations)으로 구현됩니다.

처음 두 명령은 메타데이터만 변경하거나 파일만 삭제하므로 경량 작업입니다.

또한 이 작업들은 복제되며, ZooKeeper를 통해 통계 메타데이터를 동기화합니다.

<div id="example">
  ## 예시:
</div>

두 개의 컬럼에 두 가지 통계 유형 추가:

```sql theme={null}
ALTER TABLE t1 MODIFY STATISTICS c, d TYPE TDigest, Uniq;
```

<Note>
  통계는 [복제된](/ko/reference/engines/table-engines/mergetree-family/replication) 변형을 포함한 [`*MergeTree`](/ko/reference/engines/table-engines/mergetree-family/mergetree) 엔진 테이블에서만 지원됩니다.
</Note>
