> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/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 VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["버전", "기본값", "설명"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        버전 이력
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

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](/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" />

`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" />

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

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

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

가능한 값:

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