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