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

> ClickHouse 中 use_skip_indexes_* 自动生成分组下的会话设置。

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

<div id="use_skip_indexes">
  ## use\_skip\_indexes
</div>

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

在查询执行期间使用数据跳过索引。

可能的值：

* 0 — 禁用。
* 1 — 启用。

<div id="use_skip_indexes_for_disjunctions">
  ## use\_skip\_indexes\_for\_disjunctions
</div>

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

使用跳过索引评估同时包含 AND 和 OR 条件的 WHERE 过滤器。示例：WHERE A = 5 AND (B = 5 OR C = 5)。
禁用时，跳过索引仍会用于评估 WHERE 条件，但其中只能包含通过 AND 连接的子句。

可能的值：

* 0 — 已禁用。
* 1 — 已启用。

<div id="use_skip_indexes_for_top_k">
  ## use\_skip\_indexes\_for\_top\_k
</div>

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

启用在 TopK 筛选中使用数据跳过索引。

启用后，如果 `ORDER BY <column> LIMIT n` 查询中的该列上存在 minmax 跳过索引，优化器会尝试使用该 minmax 索引，跳过与最终结果无关的粒度。这可以降低查询延迟。

可能的值：

* 0 — 已禁用。
* 1 — 已启用。

<div id="use_skip_indexes_if_final">
  ## use\_skip\_indexes\_if\_final
</div>

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

控制在使用 FINAL 修饰符执行查询时是否使用跳过索引。

跳过索引可能会排除包含最新数据的行 (粒度) ，从而导致带有 FINAL 修饰符的查询结果不正确。启用此设置后，即使使用 FINAL 修饰符，也会应用跳过索引，这可能提升性能，但也有遗漏最近更新的风险。此设置应与 use\_skip\_indexes\_if\_final\_exact\_mode 设置同时启用 (默认已启用) 。

可能的值：

* 0 — 禁用。
* 1 — 启用。

<div id="use_skip_indexes_if_final_exact_mode">
  ## use\_skip\_indexes\_if\_final\_exact\_mode
</div>

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

控制在使用 FINAL 修饰符执行查询时，是否在较新的 parts 中扩展跳过索引返回的粒度范围，以确保结果正确。

使用跳过索引时，可能会排除包含最新数据的行 (粒度) ，从而导致结果不正确。此设置可通过扫描与跳过索引返回范围重叠的较新 parts，确保返回正确结果。仅当应用可以接受基于跳过索引查找得到的近似结果时，才应禁用此设置。

可选值：

* 0 — 已禁用。
* 1 — 已启用。

<div id="use_skip_indexes_on_data_read">
  ## use\_skip\_indexes\_on\_data\_read
</div>

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

启用在读取数据时使用数据跳过索引。

启用后，跳过索引会在读取每个数据粒度时动态评估，而不是在查询执行开始前预先分析。这可以减少查询启动延迟。

可能值：

* 0 — 禁用。
* 1 — 启用。
