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

> 包含 MergeTree 表中 parts 和列信息的系统表。

# system.parts_columns

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

包含有关 [MergeTree](/zh/reference/engines/table-engines/mergetree-family/mergetree) 表的 parts 和列的信息。
每一行对应一个数据分区片段。

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

* `partition` ([String](/zh/reference/data-types/string)) — 分区名称。
* `name` ([String](/zh/reference/data-types/string)) — 数据分区片段名称。
* `uuid` ([UUID](/zh/reference/data-types/uuid)) — 数据分区片段的 UUID。
* `part_type` ([String](/zh/reference/data-types/string)) — 数据分区片段的存储格式。可能的值：Wide — 每列存储在文件系统中的单独文件中；Compact — 所有列存储在文件系统中的同一个文件中。
* `active` ([UInt8](/zh/reference/data-types/int-uint)) — 指示数据分区片段是否处于活动状态的标志。活动的数据分区片段会被表使用；否则会被删除。合并后，非活动的数据分区片段仍会保留。
* `marks` ([UInt64](/zh/reference/data-types/int-uint)) — 标记数。要估算数据分区片段中的行数，可将标记数乘以索引粒度 (通常为 8192)  (此方法不适用于自适应粒度) 。
* `rows` ([UInt64](/zh/reference/data-types/int-uint)) — 行数。
* `bytes_on_disk` ([UInt64](/zh/reference/data-types/int-uint)) — 所有数据分区片段文件的总大小，单位为字节。
* `data_compressed_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 数据分区片段中压缩数据的总大小，不包括所有辅助文件 (例如标记文件) 。
* `data_uncompressed_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 数据分区片段中未压缩数据的总大小，不包括所有辅助文件 (例如标记文件) 。
* `marks_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 标记文件的大小。
* `modification_time` ([DateTime](/zh/reference/data-types/datetime)) — 包含数据分区片段的目录的修改时间，通常对应于数据分区片段的创建时间。
* `remove_time` ([DateTime](/zh/reference/data-types/datetime)) — 数据分区片段变为非活动状态的时间。
* `refcount` ([UInt32](/zh/reference/data-types/int-uint)) — 使用数据分区片段的位置数量。值大于 2 表示该数据分区片段正用于查询或合并。
* `min_date` ([Date](/zh/reference/data-types/date)) — 如果分区键中包含 Date 列，则为该列的最小值。
* `max_date` ([Date](/zh/reference/data-types/date)) — 如果分区键中包含 Date 列，则为该列的最大值。
* `min_time` ([DateTime](/zh/reference/data-types/datetime)) — 如果分区键中包含 DateTime 列，则为该列的最小值。
* `max_time` ([DateTime](/zh/reference/data-types/datetime)) — 如果分区键中包含 DateTime 列，则为该列的最大值。
* `partition_id` ([String](/zh/reference/data-types/string)) — 分区 ID。
* `min_block_number` ([Int64](/zh/reference/data-types/int-uint)) — 合并后构成当前数据分区片段的数据分区片段的最小编号。
* `max_block_number` ([Int64](/zh/reference/data-types/int-uint)) — 合并后构成当前数据分区片段的数据分区片段的最大编号。
* `level` ([UInt32](/zh/reference/data-types/int-uint)) — 合并树的深度。零表示当前数据分区片段由插入操作创建，而非通过合并其他数据分区片段创建。
* `data_version` ([UInt64](/zh/reference/data-types/int-uint)) — 用于确定应应用于数据分区片段的变更的编号 (版本高于 data\_version 的变更) 。
* `primary_key_bytes_in_memory` ([UInt64](/zh/reference/data-types/int-uint)) — 主键值使用的内存量 (单位为字节) 。
* `primary_key_bytes_in_memory_allocated` ([UInt64](/zh/reference/data-types/int-uint)) — 为主键值预留的内存量 (单位为字节) 。
* `database` ([String](/zh/reference/data-types/string)) — 数据库名称。
* `table` ([String](/zh/reference/data-types/string)) — 表名称。
* `engine` ([String](/zh/reference/data-types/string)) — 不含参数的表引擎名称。
* `disk_name` ([String](/zh/reference/data-types/string)) — 存储数据分区片段的磁盘名称。
* `path` ([String](/zh/reference/data-types/string)) — 数据分区片段文件所在目录的绝对路径。
* `column` ([String](/zh/reference/data-types/string)) — 列名称。
* `type` ([String](/zh/reference/data-types/string)) — 列类型。
* `column_position` ([UInt64](/zh/reference/data-types/int-uint)) — 列在表中的序号，从 1 开始。
* `default_kind` ([String](/zh/reference/data-types/string)) — 默认值的表达式类型 (DEFAULT、MATERIALIZED、ALIAS) ；未定义时为空字符串。
* `default_expression` ([String](/zh/reference/data-types/string)) — 默认值表达式；未定义时为空字符串。
* `column_bytes_on_disk` ([UInt64](/zh/reference/data-types/int-uint)) — 列的总大小 (字节) 。
* `column_data_compressed_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 列中压缩数据的总大小 (字节) 。
* `column_data_uncompressed_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 列中解压后数据的总大小 (字节) 。
* `column_marks_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 列标记的大小 (字节) 。
* `column_modification_time` ([Nullable(DateTime)](/zh/reference/data-types/nullable)) — 列的最后修改时间。
* `column_ttl_min` ([Nullable(DateTime)](/zh/reference/data-types/nullable)) — 列计算出的生存时间 (TTL) 表达式的最小值。
* `column_ttl_max` ([Nullable(DateTime)](/zh/reference/data-types/nullable)) — 列计算出的生存时间 (TTL) 表达式的最大值。
* `statistics` ([Array(String)](/zh/reference/data-types/array)) — 列的统计信息。
* `estimates.min` ([Nullable(String)](/zh/reference/data-types/nullable)) — 列的估计最小值。
* `estimates.max` ([Nullable(String)](/zh/reference/data-types/nullable)) — 列的估计最大值。
* `estimates.cardinality` ([Nullable(UInt64)](/zh/reference/data-types/nullable)) — 列的估计基数。
* `estimates.null_count` ([Nullable(UInt64)](/zh/reference/data-types/nullable)) — 列中 NULL 值的估计数量。
* `estimates.default_count` ([Nullable(UInt64)](/zh/reference/data-types/nullable)) — 值等于列存储默认值的行数估计值 (Nullable 列为 NULL，非 Nullable 列为 0 / '' / \[] / ...) 。没有可用的基本统计信息时为 NULL。
* `serialization_kind` ([String](/zh/reference/data-types/string)) — 列的序列化类型
* `substreams` ([Array(String)](/zh/reference/data-types/array)) — 列序列化后写入的子流名称
* `filenames` ([Array(String)](/zh/reference/data-types/array)) — 列中各子流对应的文件名
* `subcolumns.names` ([Array(String)](/zh/reference/data-types/array)) — 列中子列的名称
* `subcolumns.types` ([Array(String)](/zh/reference/data-types/array)) — 列中子列的类型
* `subcolumns.serializations` ([Array(String)](/zh/reference/data-types/array)) — 列中子列的序列化类型
* `subcolumns.bytes_on_disk` ([Array(UInt64)](/zh/reference/data-types/array)) — 每个子列在磁盘上占用的字节数
* `subcolumns.data_compressed_bytes` ([Array(UInt64)](/zh/reference/data-types/array)) — 每个子列的压缩数据大小 (字节)
* `subcolumns.data_uncompressed_bytes` ([Array(UInt64)](/zh/reference/data-types/array)) — 每个子列的解压后数据大小 (字节)
* `subcolumns.marks_bytes` ([Array(UInt64)](/zh/reference/data-types/array)) — 列中每个子列的标记大小 (字节)

**别名：**

* `bytes` — `bytes_on_disk` 的别名。
* `marks_size` — `marks_bytes` 的别名。
* `part_name` — `name` 的别名。

<div id="example">
  ## 示例
</div>

```sql theme={null}
SELECT * FROM system.parts_columns LIMIT 1 FORMAT Vertical;
```

```text theme={null}
Row 1:
──────
partition:                             tuple()
name:                                  all_1_2_1
part_type:                             Wide
active:                                1
marks:                                 2
rows:                                  2
bytes_on_disk:                         155
data_compressed_bytes:                 56
data_uncompressed_bytes:               4
marks_bytes:                           96
modification_time:                     2020-09-23 10:13:36
remove_time:                           2106-02-07 06:28:15
refcount:                              1
min_date:                              1970-01-01
max_date:                              1970-01-01
partition_id:                          all
min_block_number:                      1
max_block_number:                      2
level:                                 1
data_version:                          1
primary_key_bytes_in_memory:           2
primary_key_bytes_in_memory_allocated: 64
database:                              default
table:                                 53r93yleapyears
engine:                                MergeTree
disk_name:                             default
path:                                  /var/lib/clickhouse/data/default/53r93yleapyears/all_1_2_1/
column:                                id
type:                                  Int8
column_position:                       1
default_kind:
default_expression:
column_bytes_on_disk:                  76
column_data_compressed_bytes:          28
column_data_uncompressed_bytes:        2
column_marks_bytes:                    48
```

<div id="see-also">
  ## 另请参阅
</div>

* [MergeTree 家族](/zh/reference/engines/table-engines/mergetree-family/mergetree)
* [计算 compact 和 wide parts 的数量及大小](/zh/resources/support-center/knowledge-base/troubleshooting/count-parts-by-type)
