title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/mutations.md)

The table contains information about [mutations](/docs/sql-reference/statements/alter#mutations) of [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree) tables and their progress. Each mutation command is represented by a single row.

## Columns:[​](#columns "Direct link to Columns:")

- `database` ([String](/docs/sql-reference/data-types/string)) — The name of the database to which the mutation was applied.
- `table` ([String](/docs/sql-reference/data-types/string)) — The name of the table to which the mutation was applied.
- `mutation_id` ([String](/docs/sql-reference/data-types/string)) — The ID of the mutation. For replicated tables these IDs correspond to znode names in the `<table_path_in_clickhouse_keeper>/mutations/` directory in ClickHouse Keeper. For non-replicated tables the IDs correspond to file names in the data directory of the table.
- `command` ([String](/docs/sql-reference/data-types/string)) — The mutation command string (the part of the query after `ALTER TABLE [db.]table`).
- `create_time` ([DateTime](/docs/sql-reference/data-types/datetime)) — Date and time when the mutation command was submitted for execution.
- `block_numbers.partition_id` ([Array](/docs/sql-reference/data-types/array)([String](/docs/sql-reference/data-types/string))) — For mutations of replicated tables, the array contains the partitions' IDs (one record for each partition). For mutations of non-replicated tables the array is empty.
- `block_numbers.number` ([Array](/docs/sql-reference/data-types/array)([Int64](/docs/sql-reference/data-types/int-uint))) — For mutations of replicated tables, the array contains one record for each partition, with the block number that was acquired by the mutation. Only parts that contain blocks with numbers less than this number will be mutated in the partition. In non-replicated tables, block numbers in all partitions form a single sequence. This means that for mutations of non-replicated tables, the column will contain one record with a single block number acquired by the mutation.
- `parts_in_progress_names` ([Array](/docs/sql-reference/data-types/array)([String](/docs/sql-reference/data-types/string))) — An array of names of data parts that are being mutated.
- `parts_to_do_names` ([Array](/docs/sql-reference/data-types/array)([String](/docs/sql-reference/data-types/string))) — An array of names of data parts that need to be mutated for the mutation to complete.
- `parts_to_do` ([Int64](/docs/sql-reference/data-types/int-uint)) — The number of data parts that need to be mutated for the mutation to complete.
- `parts_postpone_reasons` ([Map](/docs/sql-reference/data-types/map)([String](/docs/sql-reference/data-types/string))) — A map of part names to reasons why they are postponed.

Note

- If a part name is not in `parts_postpone_reasons` and has not yet been mutated, it means the part is yet not scheduled for mutation.
- The part name `all_parts` represents all parts that have not yet been mutated.

- `is_killed` ([UInt8](/docs/sql-reference/data-types/int-uint)) — Indicates whether a mutation has been killed. **Only available in ClickHouse Cloud.**

Note

`is_killed=1` does not necessarily mean the mutation is completely finalized. It is possible for a mutation to remain in a state where `is_killed=1` and `is_done=0` for an extended period. This can happen if another long-running mutation is blocking the killed mutation. This is a normal situation.

- `is_done` ([UInt8](/docs/sql-reference/data-types/int-uint)) — The flag whether the mutation is done or not. Possible values:
  - `1` if the mutation is completed,
  - `0` if the mutation is still in process.

Note

Even if `parts_to_do = 0` it is possible that a mutation of a replicated table is not completed yet because of a long-running `INSERT` query, that will create a new data part needed to be mutated.

If there were problems with mutating some data parts, the following columns contain additional information:

- `latest_failed_part` ([String](/docs/sql-reference/data-types/string)) — The name of the most recent part that could not be mutated.
- `latest_fail_time` ([DateTime](/docs/sql-reference/data-types/datetime)) — The date and time of the most recent part mutation failure.
- `latest_fail_reason` ([String](/docs/sql-reference/data-types/string)) — The exception message that caused the most recent part mutation failure.

## Monitoring Mutations[​](#monitoring-mutations "Direct link to Monitoring Mutations")

To track the progress on the `system.mutations` table, use the following query:

```
SELECT * FROM clusterAllReplicas('cluster_name', 'system', 'mutations')
WHERE is_done = 0 AND table = 'tmp';

-- or

SELECT * FROM clusterAllReplicas('cluster_name', 'system.mutations')
WHERE is_done = 0 AND table = 'tmp';
```

Note: this requires read permissions on the `system.*` tables.

Cloud usage

In ClickHouse Cloud the `system.mutations` table on each node has all the mutations in the cluster, and there is no need for `clusterAllReplicas`.

**See Also**

- [Mutations](/docs/sql-reference/statements/alter#mutations)
- [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree) table engine
- [ReplicatedMergeTree](/docs/engines/table-engines/mergetree-family/replication) family

- [Columns:](#columns)- [Monitoring Mutations](#monitoring-mutations)

Was this page helpful?