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

# allow_* MergeTree 表设置

> ClickHouse 在 allow_* 自动生成分组中的 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>;
};

export const ExperimentalBadge = () => {
  return <div className="experimentalBadge">
            <div className="experimentalIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.25" d="M5.5 2H10.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M9.50015 2V6.19625L13.4283 12.7425C13.4738 12.8183 13.4985 12.9049 13.4996 12.9934C13.5008 13.0818 13.4785 13.169 13.435 13.246C13.3914 13.323 13.3283 13.3871 13.2519 13.4317C13.1755 13.4764 13.0886 13.4999 13.0002 13.5H3.00015C2.91164 13.5 2.8247 13.4766 2.74822 13.432C2.67174 13.3874 2.60847 13.3233 2.56487 13.2463C2.52126 13.1693 2.49889 13.082 2.50004 12.9935C2.50119 12.905 2.52582 12.8184 2.5714 12.7425L6.50015 6.19625V2" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M4.47656 9.56754C5.30344 9.41254 6.47656 9.47942 7.99969 10.25C10.0153 11.2707 11.4216 11.0569 12.2184 10.7282" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
        </div>
            Experimental 功能。 <u><a href="/docs/docs/beta-and-experimental-features#experimental-features">了解详情。</a></u>
        </div>;
};

这些设置可在 [system.merge\_tree\_settings](/docs/zh/reference/system-tables/merge_tree_settings) 中查看，且由 ClickHouse 源代码自动生成。

<div id="allow_coalescing_columns_in_partition_or_order_key">
  ## allow\_coalescing\_columns\_in\_partition\_or\_order\_key
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": "0"},{"label": "新增设置，允许在分区键或排序键中使用合并列。"}]}]} />

启用后，允许在 CoalescingMergeTree 表中将合并列用作
分区键或排序键。

<div id="allow_commit_order_projection">
  ## allow\_commit\_order\_projection
</div>

<ExperimentalBadge />

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.4"},{"label": "0"},{"label": "新设置"}]}]} />

启用提交顺序投影，该投影会存储 `_block_number` 和 `_block_offset` 虚拟列，并在合并过程中保留原始插入顺序。
需要启用 `enable_block_number_column` 和 `enable_block_offset_column`。

<div id="allow_dimensions_outside_sorting_key">
  ## allow\_dimensions\_outside\_sorting\_key
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.7"},{"label": "0"},{"label": "AggregatingMergeTree 现在会在创建表时拒绝这类 schema：某列既不属于 排序键，也不是 aggregate state 度量；此前这类 schema 会被接受（旧行为对应值为 'true'）。"}]}]} />

在 `AggregatingMergeTree` 中，background merges 会折叠 排序键
key 值相同的行，并合并它们的 aggregate states。某个列如果既不属于 排序键，也不是
aggregate state *measure* (`AggregateFunction` 或 `SimpleAggregateFunction`) ，那它就是一个 *dimension*：在
merge 之后，它会保留被折叠行中任意一行的值，这会悄悄导致对该列执行 `GROUP BY` 或按其过滤的查询得到错误
结果 (参见
[https://github.com/ClickHouse/ClickHouse/issues/751](https://github.com/ClickHouse/ClickHouse/issues/751)) 。

默认情况下，创建表时会拒绝这种 schema。如果该列在函数上依赖于 排序键 (也就是说，所有被折叠的行都具有相同的值) ，并且这种
行为是有意的，请启用此设置。

该检查仅适用于实际发生聚合的表 (即至少包含一个 aggregate state
列的表) ，并且在启用 `allow_tuple_element_aggregation` 时会跳过。

<div id="allow_floating_point_partition_key">
  ## allow\_floating\_point\_partition\_key
</div>

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

启用后可将浮点数作为分区键。

可能的值：

* `0` — 不允许使用浮点数分区键。
* `1` — 允许使用浮点数分区键。

<div id="allow_minmax_index_for_json">
  ## allow\_minmax\_index\_for\_json
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.7"},{"label": "0"},{"label": "默认禁止在 JSON 列上创建 minmax 跳过索引，因为该索引的序列化无法处理异构的 Field 值"}]}]} />

允许在 JSON (Object) 列上创建 minmax 跳过索引。默认情况下禁用，因为 minmax
索引的序列化路径无法处理 JSON 列中可能包含的异构 Field 值。

<div id="allow_nullable_key">
  ## allow\_nullable\_key
</div>

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

允许将 Nullable 类型作为主键。

<div id="allow_part_offset_column_in_projections">
  ## allow\_part\_offset\_column\_in\_projections
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "1"},{"label": "现在投影可以使用 `_part_offset` 列。"}]}, {"id": "row-2","items": [{"label": "25.5"},{"label": "0"},{"label": "新设置，用于在其稳定之前防止创建带有父 part 的 offset 列的投影。"}]}]} />

允许在投影的 select 查询中使用 `_part_offset` 列。

<div id="allow_reduce_blocking_parts_task">
  ## allow\_reduce\_blocking\_parts\_task
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.2"},{"label": "1"},{"label": "现在，SMT 默认会从 ZooKeeper 中移除陈旧的阻塞 parts"}]}, {"id": "row-2","items": [{"label": "25.1"},{"label": "0"},{"label": "Cloud sync"}]}]} />

用于减少 shared merge tree 表中阻塞 parts 的后台任务。
仅适用于 ClickHouse Cloud

<div id="allow_remote_fs_zero_copy_replication">
  ## allow\_remote\_fs\_zero\_copy\_replication
</div>

<ExperimentalBadge />

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

请勿在生产环境中使用此设置，因为它尚未准备就绪。

<div id="allow_summing_columns_in_partition_or_order_key">
  ## allow\_summing\_columns\_in\_partition\_or\_order\_key
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.4"},{"label": "0"},{"label": "允许将求和列用作分区键或排序键的新设置"}]}]} />

启用后，允许在 SummingMergeTree 表中将求和列用作
分区键或排序键。

<div id="allow_suspicious_indices">
  ## allow\_suspicious\_indices
</div>

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

拒绝使用相同表达式的主索引/二级索引和排序键

<div id="allow_tuple_element_aggregation">
  ## allow\_tuple\_element\_aggregation
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.6"},{"label": "0"},{"label": "新增设置"}]}]} />

启用后，Tuple 列中的各个元素会在
SummingMergeTree、AggregatingMergeTree 和
CoalescingMergeTree 合并期间参与聚合。嵌套的 Tuple 会被递归展开，因此所有
叶子元素都会被分别聚合。此设置不可更改，
必须在创建表时指定。

<div id="allow_vertical_merges_from_compact_to_wide_parts">
  ## allow\_vertical\_merges\_from\_compact\_to\_wide\_parts
</div>

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

允许将 compact parts 垂直合并为 wide parts。此设置在所有副本上必须保持相同的值。
