> ## 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_query_* 会话设置

> ClickHouse 中 use_query_* 生成组的会话设置。

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/zh/reference/system-tables/settings) 中查看，并由 [源文件](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

<div id="use_query_cache">
  ## use\_query\_cache
</div>

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

启用后，`SELECT` 查询可使用[查询缓存](/docs/zh/concepts/features/performance/caches/query-cache)。参数 [enable\_reads\_from\_query\_cache](/docs/zh/reference/settings/session-settings/enable#enable_reads_from_query_cache)
和 [enable\_writes\_to\_query\_cache](/docs/zh/reference/settings/session-settings/enable#enable_writes_to_query_cache) 可进一步控制缓存的使用方式。

可能的值：

* 0 - 已禁用
* 1 - 已启用

<div id="use_query_condition_cache">
  ## use\_query\_condition\_cache
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.4"},{"label": "1"},{"label": "新增优化"}]}, {"id": "row-2","items": [{"label": "25.3"},{"label": "0"},{"label": "新设置。"}]}]} />

启用[查询条件缓存](/docs/zh/concepts/features/performance/caches/query-condition-cache)。该缓存会存储数据分区片段中不满足 `WHERE` 子句条件的粒度范围，
并将这些信息作为临时索引在后续查询中复用。

可能的值：

* 0 - 禁用
* 1 - 启用
