> ## 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.

# query_cache_* 세션 설정

> query_cache_*로 생성된 그룹의 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="query_cache_compress_entries">
  ## query\_cache\_compress\_entries
</div>

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

[쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)의 엔트리를 압축합니다. 쿼리 캐시의 메모리 사용량을 줄이는 대신, 캐시에 대한 삽입 및 읽기가 느려집니다.

가능한 값:

* 0 - 비활성화됨
* 1 - 활성화됨

<div id="query_cache_for_subqueries">
  ## query\_cache\_for\_subqueries
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.5"},{"label": "0"},{"label": "모든 서브쿼리에 `use_query_cache`가 전파되도록 활성화하는 새로운 설정입니다. 이 설정이 없으면 서브쿼리는 각 서브쿼리에서 명시적으로 `SETTINGS use_query_cache = true`를 설정해 옵트인한 경우에만 캐시됩니다."}]}]} />

활성화하면 서브쿼리 결과를 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에 저장하고, 여기서 읽어올 수 있습니다. 이렇게 하면 `use_query_cache`가 모든 서브쿼리에 전파됩니다.

가능한 값:

* 0 - 비활성화됨
* 1 - 활성화됨

<div id="query_cache_max_entries">
  ## query\_cache\_max\_entries
</div>

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

현재 사용자가 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에 저장할 수 있는 쿼리 결과의 최대 개수입니다. 0은 무제한을 의미합니다.

가능한 값:

* 0 이상의 정수

<div id="query_cache_max_size_in_bytes">
  ## query\_cache\_max\_size\_in\_bytes
</div>

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

현재 사용자가 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에 할당할 수 있는 최대 메모리 크기(바이트)입니다. 0은 제한이 없음을 의미합니다.

가능한 값:

* 0 이상의 정수.

<div id="query_cache_min_query_duration">
  ## query\_cache\_min\_query\_duration
</div>

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

쿼리 결과가 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에 저장되려면 쿼리가 최소 몇 밀리초 동안 실행되어야 하는지를 지정합니다.

가능한 값:

* 0 이상의 정수.

<div id="query_cache_min_query_runs">
  ## query\_cache\_min\_query\_runs
</div>

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

결과가 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에 저장되기 전에 `SELECT` 쿼리가 실행되어야 하는 최소 횟수입니다.

가능한 값:

* 0 이상의 정수.

<div id="query_cache_nondeterministic_function_handling">
  ## query\_cache\_nondeterministic\_function\_handling
</div>

<SettingsInfoBlock type="QueryResultCacheNondeterministicFunctionHandling" default_value="throw" />

`rand()` 또는 `now()`와 같은 비결정적 함수가 포함된 `SELECT` 쿼리를 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에서 어떻게 처리할지 제어합니다.

가능한 값:

* `'throw'` - 예외를 발생시키고 쿼리 결과를 캐시하지 않습니다.
* `'save'` - 쿼리 결과를 캐시합니다.
* `'ignore'` - 쿼리 결과를 캐시하지 않고 예외도 발생시키지 않습니다.

<div id="query_cache_share_between_users">
  ## query\_cache\_share\_between\_users
</div>

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

이 설정을 활성화하면 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에 캐시된 `SELECT` 쿼리 결과를 다른 사용자도 읽을 수 있습니다.
보안상의 이유로 이 설정을 활성화하는 것은 권장되지 않습니다.

가능한 값:

* 0 - 비활성화됨
* 1 - 활성화됨

<div id="query_cache_squash_partial_results">
  ## query\_cache\_squash\_partial\_results
</div>

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

부분 결과 블록을 [max\_block\_size](/docs/ko/reference/settings/session-settings/max#max_block_size) 크기의 블록으로 병합합니다. [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)에 대한 삽입 성능은 저하되지만, 캐시 엔트리의 압축 효율은 향상됩니다([query\_cache\_compress-entries](/docs/ko/reference/settings/session-settings/query-cache#query_cache_compress_entries) 참조).

가능한 값:

* 0 - 비활성화
* 1 - 활성화

<div id="query_cache_system_table_handling">
  ## query\_cache\_system\_table\_handling
</div>

<SettingsInfoBlock type="QueryResultCacheSystemTableHandling" default_value="throw" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.4"},{"label": "throw"},{"label": "쿼리 캐시가 더 이상 시스템 테이블에 대한 쿼리 결과를 캐시하지 않습니다"}]}]} />

[쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)가 시스템 테이블, 즉 `system.*` 및 `information_schema.*` 데이터베이스의 테이블에 대한 `SELECT` 쿼리를 어떻게 처리할지 제어합니다.

가능한 값:

* `'throw'` - 예외를 발생시키고 쿼리 결과를 캐시하지 않습니다.
* `'save'` - 쿼리 결과를 캐시합니다.
* `'ignore'` - 쿼리 결과를 캐시하지 않으며 예외도 발생시키지 않습니다.

<div id="query_cache_tag">
  ## query\_cache\_tag
</div>

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.8"},{"label": ""},{"label": "쿼리 캐시 설정에 레이블을 지정하기 위한 새로운 설정."}]}]} />

[쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache) 엔트리의 레이블 역할을 하는 문자열입니다.
동일한 쿼리라도 태그가 다르면 쿼리 캐시에서는 서로 다른 것으로 간주됩니다.

가능한 값:

* 임의의 문자열

<div id="query_cache_ttl">
  ## query\_cache\_ttl
</div>

<SettingsInfoBlock type="Seconds" default_value="60" />

이 시간이 지나면 [쿼리 캐시](/docs/ko/concepts/features/performance/caches/query-cache)의 엔트리가 오래된 상태가 됩니다.

가능한 값:

* 0 이상인 정수.
