> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# use_top_k_dynamic_filtering_* 세션 설정

> 자동 생성된 use_top_k_dynamic_filtering_* 그룹에 속한 ClickHouse 세션 설정입니다.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>유형</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>기본값</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          재시작 없이 변경 가능
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

이 설정은 [system.settings](/docs/ko/reference/system-tables/settings)에서 확인할 수 있으며, [소스 코드](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp)에서 자동으로 생성됩니다.

<div id="use_top_k_dynamic_filtering">
  ## use\_top\_k\_dynamic\_filtering
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.5"},{"label": "1"},{"label": "기본적으로 TopK 쿼리에 대한 동적 필터링 최적화를 활성화합니다"}]}, {"id": "row-2","items": [{"label": "25.12"},{"label": "0"},{"label": "새 설정입니다."}]}]} />

`ORDER BY <column> LIMIT n` 쿼리를 실행할 때 동적 필터링 최적화를 활성화합니다.

활성화되면 쿼리 실행기는 결과 집합의 최종 `top N` 행에 포함되지 않을 그래뉼과 행을 건너뛰려고 시도합니다. 이 최적화는 동적으로 작동하며, 지연 시간 개선 효과는 데이터 분포와 쿼리 내 다른 프레디케이트의 존재 여부에 따라 달라집니다.

가능한 값:

* 0 — 비활성화됨.
* 1 — 활성화됨.

<div id="use_top_k_dynamic_filtering_for_variable_length_types">
  ## use\_top\_k\_dynamic\_filtering\_for\_variable\_length\_types
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.5"},{"label": "0"},{"label": "기본적으로 가변 길이 정렬 컬럼(예: `String`)에 대해서는 `use_top_k_dynamic_filtering`을 비활성화합니다. 이전 동작에서는 이 최적화가 조건 없이 적용되었으며, 해당 동작은 `compatibility`에서 유지됩니다."}]}]} />

정렬 컬럼이 가변 길이 데이터 타입(예: `String`, `Array`, `Map`, 가변 길이 원소를 포함하는 `Tuple`)인 경우 `use_top_k_dynamic_filtering`을 적용할 수 있도록 합니다.

이러한 타입에서는 동적 필터가 수행하는 행별 임계값 비교 비용이, 컬럼의 사전식 최소값이 지배적이고(예: 대부분이 빈 문자열) 건너뛸 수 있는 그래뉼이 적을 때, 절감되는 비용보다 더 커질 수 있습니다. 이런 경우 동적 필터는 쿼리 지연 시간을 개선하기는커녕 오히려 악화시킵니다.

이 설정이 `0`이면 동적 필터링은 메모리에서 값의 최대 크기가 고정된 컬럼(숫자, `Date`, `DateTime`, `FixedString`, `Enum`, 이러한 타입의 `Nullable`, 이러한 타입으로 구성된 `Tuple`)에만 제한됩니다. `1`로 설정하면 동적 필터링이 가변 길이 타입에도 적용됩니다.

가능한 값:

* 0 — 비활성화됨.
* 1 — 활성화됨.
