> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# enable_join_* 会话设置

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

export const BetaBadge = ({link, galaxyTrack, galaxyEvent}) => {
  if (link) {
    return <a href={link} target="_blank" rel="noopener noreferrer" className="betaBadge" onClick={galaxyTrack && galaxyEvent ? galaxyOnClick(galaxyEvent) : undefined}>
                <span>Beta</span>
            </a>;
  }
  return <a href="https://clickhouse.com/docs/reference/settings/beta-and-experimental-features#beta-features" className="betaBadge">
            <span>Beta 版功能</span>
        </a>;
};

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) 自动生成。

## enable\_join\_fixed\_hash\_table\_conversion

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.4"},{"label": "1"},{"label": "新增此设置，用于在键为单个整数且取值范围较小时，将用于 JOIN 的哈希表转换为扁平数组。"}]}]} />

启用此功能：在键为单个整数且取值范围较小时，将用于 JOIN 的哈希表转换为扁平数组。

## enable\_join\_key\_only\_hash\_tables

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.9"},{"label": "1"},{"label": "新增设置：对于结果绝不会包含右侧行中值的 JOIN，仅在哈希表中存储连接键，而不引用右侧行（`LEFT ANTI`，以及未选择右侧列时的 `LEFT SEMI`）。"}]}]} />

对于结果绝不会包含右侧行中值的 JOIN，使用仅存储连接键而不引用右侧行的哈希表：`LEFT ANTI`，以及未选择右侧列时的 `LEFT SEMI`。此类表的单元更小，并且可丢弃右侧块而无需存储。

## enable\_join\_runtime\_filters

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.9"},{"label": "1"},{"label": "JOIN 运行时过滤器成为 Production 层级功能。"}]}, {"id": "row-2","items": [{"label": "26.2"},{"label": "1"},{"label": "启用此优化"}]}, {"id": "row-3","items": [{"label": "25.10"},{"label": "0"},{"label": "新设置"}]}]} />

在运行时，根据从右侧收集到的一组 JOIN 连接键对左侧进行过滤。

## enable\_join\_runtime\_filters\_index\_analysis

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.9"},{"label": "0"},{"label": "JOIN 运行时过滤器已成为 Production 层级功能。"}]}, {"id": "row-2","items": [{"label": "26.7"},{"label": "0"},{"label": "用于通过动态索引分析启用 join 筛选的新设置"}]}]} />

执行第二轮索引分析 (通过 use\_skip\_indexes\_on\_data\_read) ，以对 join 左侧的粒度进行剪枝。

## enable\_join\_transitive\_predicates

<BetaBadge />

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.6"},{"label": "1"},{"label": "默认启用 enable_join_transitive_predicates"}]}, {"id": "row-2","items": [{"label": "26.4"},{"label": "0"},{"label": "用于推断传递性等值 JOIN 谓词、以优化 JOIN 顺序的新设置。"}]}]} />

根据现有的 JOIN 条件推断传递性等值 JOIN 谓词。
例如，给定 `A.x = B.x` 和 `B.x = C.x`，会添加一个合成的 `A.x = C.x` 谓词，
这样 JOIN 顺序优化器就可以考虑直接的 (A JOIN C) 执行计划。
