The System table system.mutations stores information about ongoing Data change Actions, such as UPDATE, DELETE, and ALTER.
| | | | \
| Name | Data type | Description of field meaning | |
|---|---|---|---|
| \ | |||
| database | String | The Database name to which the change Action belongs. | |
| \ | |||
| table | String | The table name corresponding to the change Action. | |
| \ | |||
| mutation_id | String | The ID of the change. | \ |
| \ | |||
* For Copy tables, mutation_id corresponds to the znode Name in the <table_path>/mutations/ directory in ByteHouse Keeper. | \ | ||
* For Not Copy tables, mutation_id corresponds to the file Name in the Data directory of the table. | |||
| \ | |||
| query_id | UUID | The Search UUID that triggers the change Action. | |
| \ | |||
| command | String | The specific Content of the change command (the Core statement after ALTER TABLE [db.]table). | |
| \ | |||
| create_time | DateTime | The Date and Time when the change command is submitted for execution. | |
| \ | |||
| cnch | UInt8 | Indicates whether it is a change marker for a Cnch engine table. | \ |
| \ | |||
| * 1 = Yes (Cnch engine table); | \ | ||
| * 0 = No (Other engine tables). | |||
| \ | |||
| block_numbers.partition_id | Array(String) | For Copy tables, the array contains the Partition IDs (one Record per Partition). For Not Copy tables, this value is empty. | |
| \ | |||
| block_numbers.number | Arrart(Int64) | For Copy tables, the array contains one Record per Partition, displaying the block number acquired by the change. Only the Part in the Partition that contains blocks smaller than this number will be changed. | \ |
| In Not Copy tables, the block numbers of all Partitions form a single sequence. This means that for changes to Not Copy tables, this column will contain one Record, which is the single block number acquired by the change. | |||
| \ | |||
| parts_to_do_names | Array(String) | An array of pending shard Names (shards for which the change is not yet complete). | |
| \ | |||
| parts_to_do | Int64 | The total number of pending shards, used to calculate Progress. | |
| \ | |||
| is_done | UInt8 | The completion State of the change Action: | \ |
| \ | |||
| * 1 = Done; | \ | ||
| * 0 = In progress. | |||
| \ | |||
| latest_failed_part | String | Name of the last shard that could not be changed. | |
| \ | |||
| latest_fail_time | DateTime | Date and Time of the last Part change failed. | |
| \ | |||
| latest_fail_reason | String | The abnormal Message that caused the last Part change to fail. | |
| \ | |||
| settings | String | The session settings used when executing the change Action. |
Query the change status of a specified table:
SELECT database, table, mutation_id, create_time, command FROM system.mutations WHERE database = 'sales_db' AND table = 'order_details_test' ORDER BY create_time DESC;
Query results example: