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

# always_fetch_* MergeTree 表设置

> ClickHouse MergeTree 表中 always_fetch_* 自动生成组的设置。

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.merge\_tree\_settings](/docs/zh/reference/system-tables/merge_tree_settings) 中查看，由 ClickHouse 源代码自动生成。

<div id="always_fetch_merged_part">
  ## always\_fetch\_merged\_part
</div>

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

如果为 true，此副本从不合并 parts，而是始终从其他副本下载已合并的 parts。

可能的值：

* true, false

<div id="always_fetch_mutated_part">
  ## always\_fetch\_mutated\_part
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.8"},{"label": "0"},{"label": "新增设置，使副本拉取已变更的 parts，而非在本地执行变更"}]}]} />

如果为 true，此副本绝不会执行 `MUTATE_PART` 复制日志条目
(例如 `ALTER TABLE ... UPDATE/DELETE` 等常规变更) ，而是始终
从其他副本下载生成的已变更 parts。

至少必须有一个副本禁用此设置；否则变更
无法完成。

此设置不影响由轻量级更新创建的补丁分区片段：
在合并 parts 时，仍会在本地应用这些补丁分区片段。同时启用
`always_fetch_merged_part`，还可将合并 (包括应用补丁分区片段)
也卸载给其他副本。

由于此副本不执行变更，且变更失败状态
仅在各副本本地保存，因此在此副本上同步等待时，无法获知执行
变更的副本上发生的变更失败。因此，同步变更 (`mutations_sync` = 1
或 2) 以及修改数据的同步 `ALTER` 查询
(`alter_sync` = 1 或 2) 会在此类副本上被拒绝，并返回
`SUPPORT_IS_DISABLED` 错误，而不会进行在变更失败时可能
无限等待的操作。请使用 `mutations_sync` = 0 (`alter_sync` = 0) ，或在执行
变更的副本上发出这些查询。

可能的值：

* true、false
