> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 包含 MergeTree 表中 detached 分片 信息的系统表

# system.detached_parts

<div id="purpose">
  ## 描述
</div>

包含有关 [MergeTree](/zh/reference/engines/table-engines/mergetree-family/mergetree) 表的 detached 分片 的信息。`reason` 列说明该 分片 被 detached 的原因。

对于用户执行 detach 的 分片，`reason` 为空。此类 分片 可通过 [ALTER TABLE ATTACH PARTITION|PART](/zh/reference/statements/alter/partition#attach-partitionpart) 命令重新附加。

有关其他列的说明，请参见 [system.parts](/zh/reference/system-tables/parts)。

如果 分片 名称无效，某些列的值可能为 `NULL`。此类 分片 可通过 [ALTER TABLE DROP DETACHED PART](/zh/reference/statements/alter/partition#drop-detached-partitionpart) 删除。

<div id="columns">
  ## 列
</div>

* `database` ([String](/zh/reference/data-types)) — 该数据分区分片所属数据库的名称。
* `table` ([String](/zh/reference/data-types)) — 该数据分区分片所属表的名称。
* `partition_id` ([Nullable(String)](/zh/reference/data-types)) — 该数据分区分片所属分区的标识符。
* `name` ([String](/zh/reference/data-types)) — 该数据分区分片的名称。
* `bytes_on_disk` ([UInt64](/zh/reference/data-types)) — 该数据分区分片所有文件的总大小 (以字节为单位) 。
* `modification_time` ([DateTime](/zh/reference/data-types)) — 包含该数据分区分片的目录的修改时间。通常对应于执行 detach 操作的时间。
* `disk` ([String](/zh/reference/data-types)) — 存储该数据分区分片的磁盘名称。
* `path` ([String](/zh/reference/data-types)) — 该数据分区分片文件在磁盘上的路径。
* `reason` ([Nullable(String)](/zh/reference/data-types)) — 该数据分区分片被 detached 的原因。
* `min_block_number` ([Nullable(Int64)](/zh/reference/data-types)) — 合并后构成当前数据分区分片的最小数据分区分片编号。
* `max_block_number` ([Nullable(Int64)](/zh/reference/data-types)) — 合并后构成当前数据分区分片的最大数据分区分片编号。
* `level` ([Nullable(UInt32)](/zh/reference/data-types)) — 合并树的深度。0 表示当前数据分区分片是通过插入创建的，而不是通过合并其他数据分区分片创建的。
