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

# write_* MergeTree 表设置

> 归入 write_* 生成分组的 ClickHouse 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="write_final_mark">
  ## write\_final\_mark
</div>

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

已废弃设置，不起任何作用。

<div id="write_marks_for_substreams_in_compact_parts">
  ## write\_marks\_for\_substreams\_in\_compact\_parts
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "1"},{"label": "默认启用在 compact parts 中按子流写入标记"}]}, {"id": "row-2","items": [{"label": "25.5"},{"label": "0"},{"label": "新设置"}]}]} />

启用后，在 Compact parts 中将按每个子流而不是按每一列写入标记。
这样便可以高效地从数据分区片段中读取单独的子列。

例如，列 `t Tuple(a String, b UInt32, c Array(Nullable(UInt32)))` 会被序列化为以下子流：

* `t.a` 表示 tuple 元素 `a` 的 String 数据
* `t.b` 表示 tuple 元素 `b` 的 UInt32 数据
* `t.c.size0` 表示 tuple 元素 `c` 的数组大小
* `t.c.null` 表示 tuple 元素 `c` 中嵌套数组元素的 null map
* `t.c` 表示 tuple 元素 `c` 中嵌套数组元素的 UInt32 数据

启用此设置后，我们会为这 5 个子流分别写入一个标记，这意味着在需要时，可以分别从粒度中读取每个子流的
数据。例如，如果我们想读取子列 `t.c`，则只会读取
子流 `t.c.size0`、`t.c.null` 和 `t.c` 的数据，而不会读取子流 `t.a` 和 `t.b` 的数据。禁用此设置时，
我们只会为顶层列 `t` 写入一个标记，这意味着即使我们只需要某些子流的数据，也始终会从粒度中读取整列数据。
