mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
add en docs [#CLICKHOUSE-3912]
This commit is contained in:
parent
48a40f493a
commit
705616f30e
@ -87,7 +87,7 @@ Columns:
|
||||
|
||||
## system.merges
|
||||
|
||||
Contains information about merges currently in process for tables in the MergeTree family.
|
||||
Contains information about merges and part mutations currently in process for tables in the MergeTree family.
|
||||
|
||||
Columns:
|
||||
|
||||
@ -97,6 +97,7 @@ Columns:
|
||||
- `progress Float64` — The percentage of completed work from 0 to 1.
|
||||
- `num_parts UInt64` — The number of pieces to be merged.
|
||||
- `result_part_name String` — The name of the part that will be formed as the result of merging.
|
||||
- `is_mutation UInt8` - 1 if this process is a part mutation.
|
||||
- `total_size_bytes_compressed UInt64` — The total size of the compressed data in the merged chunks.
|
||||
- `total_size_marks UInt64` — The total number of marks in the merged partss.
|
||||
- `bytes_read_uncompressed UInt64` — Number of bytes read, uncompressed.
|
||||
@ -433,4 +434,30 @@ pzxid: 987021252247
|
||||
path: /clickhouse/tables/01-08/visits/replicas
|
||||
```
|
||||
|
||||
## system.mutations {#system_tables-mutations}
|
||||
|
||||
The table contains information about [mutations](../query_language/alter.md#alter-mutations) of MergeTree tables and their progress. Each mutation command is represented by a single row. The table has the following columns:
|
||||
|
||||
**database**, **table** - The name of the database and table to which the mutation was applied.
|
||||
|
||||
**mutation_id** - The ID of the mutation. For replicated tables these IDs correspond to znode names in the `<table_path_in_zookeeper>/mutations/` directory in ZooKeeper. For unreplicated tables the IDs correspond to file names in the data directory of the table.
|
||||
|
||||
**command** - The mutation command string (the part of the query after `ALTER TABLE [db.]table`).
|
||||
|
||||
**create_time** - When this mutation command was submitted for execution.
|
||||
|
||||
**block_numbers.partition_id**, **block_numbers.number** - A Nested column. For mutations of replicated tables contains one record for each partition: the partition ID and the block number that was acquired by the mutation (in each partition only parts that contain blocks with numbers less than the block number acquired by the mutation in that partition will be mutated). Because in non-replicated tables blocks numbers in all partitions form a single sequence, for mutatations of non-replicated tables the column will contain one record with a single block number acquired by the mutation.
|
||||
|
||||
**parts_to_do** - The number of data parts that need to be mutated for the mutation to finish.
|
||||
|
||||
**is_done** - Is the mutation done? Note that even if `parts_to_do = 0` it is possible that a mutation of a replicated table is not done yet because of a long-running INSERT that will create a new data part that will need to be mutated.
|
||||
|
||||
If there were problems with mutating some parts the following columns contain additional information:
|
||||
|
||||
**latest_failed_part** - The name of the most recent part that could not be mutated.
|
||||
|
||||
**latest_fail_time** - The time of the most recent part mutation failure.
|
||||
|
||||
**latest_fail_reason** - The exception message that caused the most recent part mutation failure.
|
||||
|
||||
[Original article](https://clickhouse.yandex/docs/en/operations/system_tables/) <!--hide-->
|
||||
|
@ -269,27 +269,8 @@ For *MergeTree tables mutations execute by rewriting whole data parts. There is
|
||||
|
||||
Mutations are totally ordered by their creation order and are applied to each part in that order. Mutations are also partially ordered with INSERTs - data that was inserted into the table before the mutation was submitted will be mutated and data that was inserted after that will not be mutated. Note that mutations do not block INSERTs in any way.
|
||||
|
||||
A mutation query returns immediately after the mutation entry is added (in case of replicated tables to ZooKeeper, for nonreplicated tables - to the filesystem). The mutation itself executes asynchronously using the system profile settings. To track the progress of mutations you can use the `system.mutations` table. A mutation that was successfully submitted will continue to execute even if ClickHouse servers are restarted. There is no way to roll back the mutation once it is submitted.
|
||||
A mutation query returns immediately after the mutation entry is added (in case of replicated tables to ZooKeeper, for nonreplicated tables - to the filesystem). The mutation itself executes asynchronously using the system profile settings. To track the progress of mutations you can use the [`system.mutations`](../operations/system_tables.md#system_tables-mutations) table. A mutation that was successfully submitted will continue to execute even if ClickHouse servers are restarted. There is no way to roll back the mutation once it is submitted, but if the mutation is stuck for some reason it can be cancelled with the [`KILL MUTATION`](misc.md#kill-mutation) query.
|
||||
|
||||
Entries for finished mutations are not deleted right away (the number of preserved entries is determined by the `finished_mutations_to_keep` storage engine parameter). Older mutation entries are deleted.
|
||||
|
||||
#### system.mutations Table
|
||||
|
||||
The table contains information about mutations of MergeTree tables and their progress. Each mutation command is represented by a single row. The table has the following columns:
|
||||
|
||||
**database**, **table** - The name of the database and table to which the mutation was applied.
|
||||
|
||||
**mutation_id** - The ID of the mutation. For replicated tables these IDs correspond to znode names in the `<table_path_in_zookeeper>/mutations/` directory in ZooKeeper. For unreplicated tables the IDs correspond to file names in the data directory of the table.
|
||||
|
||||
**command** - The mutation command string (the part of the query after `ALTER TABLE [db.]table`).
|
||||
|
||||
**create_time** - When this mutation command was submitted for execution.
|
||||
|
||||
**block_numbers.partition_id**, **block_numbers.number** - A Nested column. For mutations of replicated tables contains one record for each partition: the partition ID and the block number that was acquired by the mutation (in each partition only parts that contain blocks with numbers less than the block number acquired by the mutation in that partition will be mutated). Because in non-replicated tables blocks numbers in all partitions form a single sequence, for mutatations of non-replicated tables the column will contain one record with a single block number acquired by the mutation.
|
||||
|
||||
**parts_to_do** - The number of data parts that need to be mutated for the mutation to finish.
|
||||
|
||||
**is_done** - Is the mutation done? Note that even if `parts_to_do = 0` it is possible that a mutation of a replicated table is not done yet because of a long-running INSERT that will create a new data part that will need to be mutated.
|
||||
|
||||
|
||||
[Original article](https://clickhouse.yandex/docs/en/query_language/alter/) <!--hide-->
|
||||
|
@ -135,7 +135,32 @@ The response contains the `kill_status` column, which can take the following val
|
||||
|
||||
A test query (`TEST`) only checks the user's rights and displays a list of queries to stop.
|
||||
|
||||
[Original article](https://clickhouse.yandex/docs/en/query_language/misc/) <!--hide-->
|
||||
## KILL MUTATION {#kill-mutation}
|
||||
|
||||
```sql
|
||||
KILL MUTATION [ON CLUSTER cluster]
|
||||
WHERE <where expression to SELECT FROM system.mutations query>
|
||||
[TEST]
|
||||
[FORMAT format]
|
||||
```
|
||||
|
||||
Tries to cancel and remove [mutations](alter.md#alter-mutations) that are currently executing. Mutations to cancel are selected from the [`system.mutations`](../operations/system_tables.md#system_tables-mutations) table using the filter specified by the `WHERE` clause of the `KILL` query.
|
||||
|
||||
A test query (`TEST`) only checks the user's rights and displays a list of queries to stop.
|
||||
|
||||
Examples:
|
||||
|
||||
```sql
|
||||
-- Cancel and remove all mutations of the single table:
|
||||
KILL MUTATION WHERE database = 'default' AND table = 'table'
|
||||
|
||||
-- Cancel the specific mutation:
|
||||
KILL MUTATION WHERE database = 'default' AND table = 'table' AND mutation_id = 'mutation_3.txt'
|
||||
```
|
||||
|
||||
The query is useful when a mutation is stuck and cannot finish (e.g. if some function in the mutation query throws an exception when applied to the data contained in the table).
|
||||
|
||||
Changes already made by the mutation are not rolled back.
|
||||
|
||||
## OPTIMIZE
|
||||
|
||||
@ -259,3 +284,5 @@ USE db
|
||||
Lets you set the current database for the session.
|
||||
The current database is used for searching for tables if the database is not explicitly defined in the query with a dot before the table name.
|
||||
This query can't be made when using the HTTP protocol, since there is no concept of a session.
|
||||
|
||||
[Original article](https://clickhouse.yandex/docs/en/query_language/misc/) <!--hide-->
|
||||
|
Loading…
Reference in New Issue
Block a user