> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.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/index)) — 此分片所属数据库的名称。
* `table` ([String](/zh/reference/data-types/index)) — 此分片所属表的名称。
* `partition_id` ([Nullable(String)](/zh/reference/data-types/index)) — 此分片所属分区的标识符。
* `name` ([String](/zh/reference/data-types/index)) — 此分片的名称。
* `bytes_on_disk` ([UInt64](/zh/reference/data-types/index)) — 该分片所有文件的总大小，以字节为单位。
* `modification_time` ([日期时间](/zh/reference/data-types/index)) — 包含该分片的目录的修改时间。通常对应于执行 detach 的时间。
* `disk` ([String](/zh/reference/data-types/index)) — 存储此分片的 disk 名称。
* `path` ([String](/zh/reference/data-types/index)) — disk 上此分片文件的 path。
* `reason` ([Nullable(String)](/zh/reference/data-types/index)) — 此分片被 detached 的原因说明。
* `min_block_number` ([Nullable(Int64)](/zh/reference/data-types/index)) — 合并后构成当前分片的各分片中的最小编号。
* `max_block_number` ([Nullable(Int64)](/zh/reference/data-types/index)) — 合并后构成当前分片的各分片中的最大编号。
* `level` ([Nullable(UInt32)](/zh/reference/data-types/index)) — merge tree 的深度。0 表示当前分片是通过 insert 创建的，而不是通过合并其他分片创建的。
