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

# parts_to_* MergeTree 表设置

> ClickHouse 在 parts_to_* 自动生成分组中的 MergeTree 表设置。

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="parts_to_delay_insert">
  ## parts\_to\_delay\_insert
</div>

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

如果单个分区中的活跃 parts 数量超过
`parts_to_delay_insert` 的值，则会人为延缓 `INSERT`。

可能的值：

* 任意正整数。

ClickHouse 会人为延长 `INSERT` 的执行时间 (加入“sleep”) ，以便
后台合并过程能够以快于新增 parts 的速度对其进行合并。

<div id="parts_to_throw_insert">
  ## parts\_to\_throw\_insert
</div>

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

如果单个分区中的活跃 parts 数量超过
`parts_to_throw_insert` 的值，`INSERT` 将因 `Too many
parts (N). Merges are processing significantly slower than inserts`
异常而中断。

可能的值：

* 任意正整数。

为了获得 `SELECT` 查询的最佳性能，需要尽量减少要处理的 parts 数量，参见 [Merge Tree](/docs/zh/resources/develop-contribute/introduction/architecture#merge-tree)。

在 23.6 版本之前，此设置的值为 300。您可以将其设置为更高的值，这会降低出现 `parts 过多`
错误的概率，但同时 `SELECT` 性能也可能下降。此外，如果出现
merge 问题 (例如磁盘空间不足) ，与使用原始值 300 相比，您会更晚
注意到它。
