From bb725eb5c42531819763bce4dcf7b08d269fe224 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Thu, 8 Aug 2019 14:57:44 +0300 Subject: [PATCH 1/8] DOCAPI-7442: Started to write. --- docs/en/operations/system_tables.md | 88 +++++++++++++++++++---------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 14fa1ace01d..6f1ebebdff3 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -252,55 +252,81 @@ This is similar to the DUAL table found in other DBMSs. Contains information about parts of [MergeTree](table_engines/mergetree.md) tables. -Each row describes one part of the data. +Each row describes one data part. Columns: -- partition (String) – The partition name. To learn what a partition is, see the description of the [ALTER](../query_language/alter.md#query_language_queries_alter) query. +- `partition` (`String`) – The partition name. To learn what a partition is, see the description of the [ALTER](../query_language/alter.md#query_language_queries_alter) query. -Formats: -- `YYYYMM` for automatic partitioning by month. -- `any_string` when partitioning manually. + Formats: -- name (String) – Name of the data part. + - `YYYYMM` for automatic partitioning by month. + - `any_string` when partitioning manually. -- active (UInt8) – Indicates whether the part is active. If a part is active, it is used in a table; otherwise, it will be deleted. Inactive data parts remain after merging. +- `name` (`String`) – Name of the data part. -- marks (UInt64) – The number of marks. To get the approximate number of rows in a data part, multiply ``marks`` by the index granularity (usually 8192). +- `active` (`UInt8`) – Indicates whether the part is active. If a part is active, it is used in a table; otherwise, it will be deleted. Inactive data parts remain after merging. -- marks_size (UInt64) – The size of the file with marks. +- `marks` (`UInt64`) – The number of marks. To get the approximate number of rows in a data part, multiply `marks` by the index granularity (usually 8192). -- rows (UInt64) – The number of rows. +- `rows` (`UInt64`) – The number of rows. -- bytes (UInt64) – The number of bytes when compressed. +- `bytes_on_disk` (`UInt64`) – The number of bytes when compressed. -- modification_time (DateTime) – The modification time of the directory with the data part. This usually corresponds to the time of data part creation.| +- `data_compressed_bytes` (`UInt64`) – -- remove_time (DateTime) – The time when the data part became inactive. +- `data_uncompressed_bytes` (`UInt64`) – -- refcount (UInt32) – The number of places where the data part is used. A value greater than 2 indicates that the data part is used in queries or merges. +- `marks_bytes` (`UInt64`) – The size of the file with marks. -- min_date (Date) – The minimum value of the date key in the data part. +- `modification_time` (`DateTime`) – The modification time of the directory with the data part. This usually corresponds to the time of data part creation.| -- max_date (Date) – The maximum value of the date key in the data part. +- `remove_time` (`DateTime`) – The time when the data part became inactive. -- min_block_number (UInt64) – The minimum number of data parts that make up the current part after merging. +- `refcount` (`UInt32`) – The number of places where the data part is used. A value greater than 2 indicates that the data part is used in queries or merges. -- max_block_number (UInt64) – The maximum number of data parts that make up the current part after merging. +- `min_date` (`Date`) – The minimum value of the date key in the data part. -- level (UInt32) – Depth of the merge tree. If a merge was not performed, ``level=0``. +- `max_date` (`Date`) – The maximum value of the date key in the data part. -- primary_key_bytes_in_memory (UInt64) – The amount of memory (in bytes) used by primary key values. +- `min_time` (`DateTime`) – The minimum value of the date and time key in the data part. -- primary_key_bytes_in_memory_allocated (UInt64) – The amount of memory (in bytes) reserved for primary key values. +- `max_time`(`DateTime`) – The maximum value of the date and time key in the data part. -- database (String) – Name of the database. +- `partition_id` (`String`) – Id of the partition. -- table (String) – Name of the table. +- `min_block_number` (`UInt64`) – The minimum number of data parts that make up the current part after merging. -- engine (String) – Name of the table engine without parameters. +- `max_block_number` (`UInt64`) – The maximum number of data parts that make up the current part after merging. + +- `level` (`UInt32`) – Depth of the merge tree. If a merge was not performed, `level=0`. + +- `data_version` (`UInt64`) – + +- `primary_key_bytes_in_memory` (`UInt64`) – The amount of memory (in bytes) used by primary key values. + +- `primary_key_bytes_in_memory_allocated` (`UInt64`) – The amount of memory (in bytes) reserved for primary key values. + +- `is_frozen` (`UInt8`) – Flag that shows partition data backup existence. 1, the backup exists. 0, the backup doesn't exist. For more details, see [FREEZE PARTITION](../query_language/alter.md#alter_freeze-partition) + +- `database` (`String`) – Name of the database. + +- `table` (`String`) – Name of the table. + +- `engine` (`String`) – Name of the table engine without parameters. + +- `path` (`String`) – Absolute path to the folder with data part files. + +- `hash_of_all_files` (`String`) – Hash of compressed files. + +- `hash_of_uncompressed_files` (`String`) – Hash of uncompressed data. + +- `uncompressed_hash_of_compressed_files` (`String`) – Hash of the file with marks + +- `bytes` (`UInt64`) – Alias for `bytes_on_disk`. + +- `marks_size` (`UInt64`) – Alias for `marks_bytes`. -- is_frozen (UInt8) – Flag that shows partition data backup existence. 1, the backup exists. 0, the backup doesn't exist. For more details, see [FREEZE PARTITION](../query_language/alter.md#alter_freeze-partition) ## system.part_log {#system_tables-part-log} @@ -360,15 +386,15 @@ Contains information about execution of queries. For each query, you can see pro !!! note The table doesn't contain input data for `INSERT` queries. - + ClickHouse creates this table only if the [query_log](server_settings/settings.md#server_settings-query-log) server parameter is specified. This parameter sets the logging rules, such as the logging interval or the name of the table the queries will be logged in. To enable query logging, set the [log_queries](settings/settings.md#settings-log-queries) parameter to 1. For details, see the [Settings](settings/settings.md) section. The `system.query_log` table registers two kinds of queries: - + 1. Initial queries that were run directly by the client. -2. Child queries that were initiated by other queries (for distributed query execution). For these types of queries, information about the parent queries is shown in the `initial_*` columns. +2. Child queries that were initiated by other queries (for distributed query execution). For these types of queries, information about the parent queries is shown in the `initial_*` columns. Columns: @@ -380,7 +406,7 @@ Columns: - `event_date` (Date) — Event date. - `event_time` (DateTime) — Event time. - `query_start_time` (DateTime) — Start time of query processing. -- `query_duration_ms` (UInt64) — Duration of query processing. +- `query_duration_ms` (UInt64) — Duration of query processing. - `read_rows` (UInt64) — Number of read rows. - `read_bytes` (UInt64) — Number of read bytes. - `written_rows` (UInt64) — For `INSERT` queries, the number of written rows. For other queries, the column value is 0. @@ -391,7 +417,7 @@ Columns: - `query` (String) — Query string. - `exception` (String) — Exception message. - `stack_trace` (String) — Stack trace (a list of methods called before the error occurred). An empty string, if the query is completed successfully. -- `is_initial_query` (UInt8) — Kind of query. Possible values: +- `is_initial_query` (UInt8) — Kind of query. Possible values: - 1 — Query was initiated by the client. - 0 — Query was initiated by another query for distributed query execution. - `user` (String) — Name of the user who initiated the current query. @@ -413,7 +439,7 @@ Columns: - `client_version_minor` (UInt32) — Minor version of the [clickhouse-client](../interfaces/cli.md). - `client_version_patch` (UInt32) — Patch component of the [clickhouse-client](../interfaces/cli.md) version. - `http_method` (UInt8) — HTTP method that initiated the query. Possible values: - - 0 — The query was launched from the TCP interface. + - 0 — The query was launched from the TCP interface. - 1 — `GET` method was used. - 2 — `POST` method was used. - `http_user_agent` (String) — The `UserAgent` header passed in the HTTP request. From 16bab882262e5075272b6c60dba49e2887e05933 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Mon, 12 Aug 2019 13:27:28 +0300 Subject: [PATCH 2/8] DOCAPI-7442: 7442 --- docs/en/operations/system_tables.md | 14 +++++++------- docs/en/query_language/functions/hash_functions.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 6f1ebebdff3..3abbd98961f 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -271,11 +271,11 @@ Columns: - `rows` (`UInt64`) – The number of rows. -- `bytes_on_disk` (`UInt64`) – The number of bytes when compressed. +- `bytes_on_disk` (`UInt64`) – Total size of all the data part files in bytes. -- `data_compressed_bytes` (`UInt64`) – +- `data_compressed_bytes` (`UInt64`) – Total size of compressed data in the data part. All the auxiliary files (for example, files with marks) are not included. -- `data_uncompressed_bytes` (`UInt64`) – +- `data_uncompressed_bytes` (`UInt64`) – Total size of uncompressed data in the data part. All the auxiliary files (for example, files with marks) are not included. - `marks_bytes` (`UInt64`) – The size of the file with marks. @@ -301,7 +301,7 @@ Columns: - `level` (`UInt32`) – Depth of the merge tree. If a merge was not performed, `level=0`. -- `data_version` (`UInt64`) – +- `data_version` (`UInt64`) – Block number that is used to determine which mutations should be applied to the data part (the mutations with the bigger version than `data_version`). - `primary_key_bytes_in_memory` (`UInt64`) – The amount of memory (in bytes) used by primary key values. @@ -317,11 +317,11 @@ Columns: - `path` (`String`) – Absolute path to the folder with data part files. -- `hash_of_all_files` (`String`) – Hash of compressed files. +- `hash_of_all_files` (`String`) – [sipHash128](../query_language/functions/hash_functions.md#hash_functions-siphash128) of compressed files. -- `hash_of_uncompressed_files` (`String`) – Hash of uncompressed data. +- `hash_of_uncompressed_files` (`String`) – [sipHash128](../query_language/functions/hash_functions.md#hash_functions-siphash128) of uncompressed data. -- `uncompressed_hash_of_compressed_files` (`String`) – Hash of the file with marks +- `uncompressed_hash_of_compressed_files` (`String`) – [sipHash128](../query_language/functions/hash_functions.md#hash_functions-siphash128) of the file with marks. - `bytes` (`UInt64`) – Alias for `bytes_on_disk`. diff --git a/docs/en/query_language/functions/hash_functions.md b/docs/en/query_language/functions/hash_functions.md index 296cca1e712..b384dead609 100644 --- a/docs/en/query_language/functions/hash_functions.md +++ b/docs/en/query_language/functions/hash_functions.md @@ -74,7 +74,7 @@ SELECT sipHash64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00 └──────────────────────┴────────┘ ``` -## sipHash128 +## sipHash128 {#hash_functions-siphash128} Calculates SipHash from a string. Accepts a String-type argument. Returns FixedString(16). From 360b1217b9c6749f4a667230001c98c7d1db5036 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Mon, 12 Aug 2019 13:31:28 +0300 Subject: [PATCH 3/8] DOCAPI-7442: Fix. --- docs/en/operations/system_tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 3abbd98961f..2fd86b52c35 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -265,7 +265,7 @@ Columns: - `name` (`String`) – Name of the data part. -- `active` (`UInt8`) – Indicates whether the part is active. If a part is active, it is used in a table; otherwise, it will be deleted. Inactive data parts remain after merging. +- `active` (`UInt8`) – Flag that indicates whether the part is active. If a part is active, it is used in a table; otherwise, it will be deleted. Inactive data parts remain after merging. - `marks` (`UInt64`) – The number of marks. To get the approximate number of rows in a data part, multiply `marks` by the index granularity (usually 8192). From 8fcb8022c4c6349e0a448c17fd04baf006e97185 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 21 Aug 2019 12:13:25 +0300 Subject: [PATCH 4/8] Update docs/en/operations/system_tables.md Co-Authored-By: Ivan Blinkov --- docs/en/operations/system_tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 2fd86b52c35..e8c8d6692c6 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -299,7 +299,7 @@ Columns: - `max_block_number` (`UInt64`) – The maximum number of data parts that make up the current part after merging. -- `level` (`UInt32`) – Depth of the merge tree. If a merge was not performed, `level=0`. +- `level` (`UInt32`) – Depth of the merge tree. Zero means that current part was created by insert rather than by merging other parts. - `data_version` (`UInt64`) – Block number that is used to determine which mutations should be applied to the data part (the mutations with the bigger version than `data_version`). From 9a8d1266badf66a9a9c770ed7dce1072397e7e89 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 21 Aug 2019 12:14:00 +0300 Subject: [PATCH 5/8] Update docs/en/operations/system_tables.md Co-Authored-By: Ivan Blinkov --- docs/en/operations/system_tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index e8c8d6692c6..b84af27c9f1 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -301,7 +301,7 @@ Columns: - `level` (`UInt32`) – Depth of the merge tree. Zero means that current part was created by insert rather than by merging other parts. -- `data_version` (`UInt64`) – Block number that is used to determine which mutations should be applied to the data part (the mutations with the bigger version than `data_version`). +- `data_version` (`UInt64`) – Number that is used to determine which mutations should be applied to the data part (the mutations with the higher version than `data_version`). - `primary_key_bytes_in_memory` (`UInt64`) – The amount of memory (in bytes) used by primary key values. From 3862dd95df4c8a79ce8e375cf99d3b43389f44d9 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 21 Aug 2019 12:14:38 +0300 Subject: [PATCH 6/8] Update docs/en/operations/system_tables.md Co-Authored-By: Ivan Blinkov --- docs/en/operations/system_tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index b84af27c9f1..26fff2cf181 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -405,7 +405,7 @@ Columns: - 4 — Exception during the query execution. - `event_date` (Date) — Event date. - `event_time` (DateTime) — Event time. -- `query_start_time` (DateTime) — Start time of query processing. +- `query_start_time` (DateTime) — Start time of query execution. - `query_duration_ms` (UInt64) — Duration of query processing. - `read_rows` (UInt64) — Number of read rows. - `read_bytes` (UInt64) — Number of read bytes. From 0b273cdf91efbeb6a1548f59f910414bb53050ef Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 21 Aug 2019 12:14:50 +0300 Subject: [PATCH 7/8] Update docs/en/operations/system_tables.md Co-Authored-By: Ivan Blinkov --- docs/en/operations/system_tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 26fff2cf181..3880663eae2 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -406,7 +406,7 @@ Columns: - `event_date` (Date) — Event date. - `event_time` (DateTime) — Event time. - `query_start_time` (DateTime) — Start time of query execution. -- `query_duration_ms` (UInt64) — Duration of query processing. +- `query_duration_ms` (UInt64) — Duration of query execution. - `read_rows` (UInt64) — Number of read rows. - `read_bytes` (UInt64) — Number of read bytes. - `written_rows` (UInt64) — For `INSERT` queries, the number of written rows. For other queries, the column value is 0. From 209af3e1c499bb47ca817f6003e14dad0a0204fa Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 21 Aug 2019 13:18:41 +0300 Subject: [PATCH 8/8] DOCAPI-7442: Clarification --- docs/en/operations/system_tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 3880663eae2..a2d9bc02ebb 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -267,7 +267,7 @@ Columns: - `active` (`UInt8`) – Flag that indicates whether the part is active. If a part is active, it is used in a table; otherwise, it will be deleted. Inactive data parts remain after merging. -- `marks` (`UInt64`) – The number of marks. To get the approximate number of rows in a data part, multiply `marks` by the index granularity (usually 8192). +- `marks` (`UInt64`) – The number of marks. To get the approximate number of rows in a data part, multiply `marks` by the index granularity (usually 8192) (this hint doesn't work for adaptive granularity). - `rows` (`UInt64`) – The number of rows.