The system table system.cnch_parts contains information about all stored data parts, covering key attributes such as part storage, state, transactions, and associated tables. It can be used to monitor the part life cycle and troubleshoot data storage problems. It is recommended to use this system table instead of system.parts.
| | | | \
| Field name | Data type | Description | |
|---|---|---|---|
| \ | |||
| database | String | The database name to which the part belongs. | |
| \ | |||
| table | String | The name of the table to which the part belongs. | |
| \ | |||
| table_uuid | UUID | The unique UUID identifier of the table to which the part belongs. | |
| \ | |||
| partition | String | The partition name where the part is located. | |
| \ | |||
| name | String | The name of the part. | |
| \ | |||
| chain_depth | UInt64 | The version chain length relative to the mutation baseline. | |
| \ | |||
| bytes_on_disk | UInt64 | The size of the part on disk, in bytes. | |
| \ | |||
| rows_count | UInt64 | Total number of rows contained in the part. | |
| \ | |||
| delete_rows | UInt64 | Number of rows marked as deleted in the part. | |
| \ | |||
| columns | String | Column information contained in the part. | |
| \ | |||
| marks_count | UInt64 | Number of marks in the part. | |
| \ | |||
| index_granularity | Array(UInt64) | Index granularity array of the part. | |
| \ | |||
| commit_time | DateTime | Time when the part is submitted to ByteKV (metadata storage). | |
| \ | |||
| kv_commit_time | DateTime | Submission time corresponding to the schema version used by the part. | |
| \ | |||
| columns_commit_time | DateTime | Submission time for mutation tasks that do not change the table schema, such as data updates. | |
| \ | |||
| mutation_commit_time | DateTime | Submission time for mutation tasks involving table schema changes. | |
| \ | |||
| previous_version | UInt64 | After a mutation is executed, the new part points to the commit_time of the original part for version tracing. | |
| \ | |||
| partition_id | String | The unique identifier (ID) of the partition where the part is located. | |
| \ | |||
| bucket_number | UInt64 | Bucket hash result of the part. | |
| \ | |||
| total_bucket_cnt | UInt64 | Total number of buckets. | |
| \ | |||
| table_definition_hash | UInt64 | Hash value of the table definition. | |
| \ | |||
| outdated | UInt8 | Whether the part is outdated: | \ |
| \ | |||
| * 1 = outdated; | \ | ||
| * 0 = not outdated. | |||
| \ | |||
| visible | UInt8 | Whether the part is visible to queries: | \ |
| \ | |||
| * 1 = visible; | \ | ||
| * 0 = not visible. | |||
| \ | |||
| part_type | Enum8 | Part type. Enumeration values include: | \ |
| \ | |||
* VisiblePart (1): visible and active part | \ | ||
* InvisiblePart (2): temporary part that is not visible | \ | ||
* Tombstone (3): tombstone part (marked as deleted) | \ | ||
* DroppedPart (4): deleted part | |||
| \ | |||
| data_type | String | Data type. | |
| \ | |||
| layout_type | String | Storage layout type. | |
| \ | |||
| part_id | UUID | The unique UUID identifier of the part. | |
| \ | |||
| commit_ts | UInt64 | Commit timestamp of the part in the transaction. | |
| \ | |||
| end_ts | UInt64 | Timestamp when the part is marked as unavailable, such as when triggered by truncate or merge operations. | |
| \ | |||
| last_modification_time | DateTime | Last time the part was modified. | |
| \ | |||
| active | UInt8 | Whether the part is available: | \ |
| \ | |||
| * 1 = available; | \ | ||
| * 0 = not available. | |||
| \ | |||
| bytes | UInt64 | Logical data size of the part, in bytes. | |
| \ | |||
| rows | UInt64 | Logical number of rows in the part. |
The following example shows how to query the system table system.cnch_parts for the table order_details:
SELECT * FROM system.cnch_parts WHERE database = 'sales_db' -- Replace with the database name of the table you want to query AND table = 'order_details'; -- Replace with the table name you want to query
Example query results: