From 912d8d0f10c21204008f3fac0984b21657d42a87 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Sat, 8 Oct 2022 17:29:06 +0800 Subject: [PATCH 1/3] sysvar: add 2 sysvars --- system-variables.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/system-variables.md b/system-variables.md index 0dc7111cd0c6f..d85b1e6842996 100644 --- a/system-variables.md +++ b/system-variables.md @@ -152,7 +152,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Default value: `utf8mb4_bin` -- This variable indicates the collation for string literals that do not have a specified collation. +- This variable indicates the collation used in the current connection. It is consistent with the MySQL variable `collation_connection`. ### collation_database @@ -166,7 +166,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Default value: `utf8mb4_bin` -- The default collation for the server. +- The default collation for a database when the database is created. ### cte_max_recursion_depth @@ -268,7 +268,7 @@ For more possible values of this variable, see [Authentication plugin status](/s ### identity -This variable is an alias for `last_insert_id`. +This variable is an alias for [`last_insert_id`](#last_insert_id). ### init_connect @@ -397,6 +397,15 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count'; 1 row in set (0.00 sec) ``` +### max_allowed_packet New in v6.1.0 + +- Scope: SESSION | GLOBAL +- Persists to cluster: Yes +- Default value: `67108864` +- Range: `[1024, 1073741824]`. The value should be an integer multiple of 1024. If the value is not divisible by 1024, a warning will be prompted and the value will be rounded down. For example, when the value is set to 1025, the actual value in TiDB is 1024. +- The maximum packet size allowed by the server and the client in one transmission of packets, in bytes. +- This variable is compatible with MySQL. + ### plugin_dir - Scope: GLOBAL @@ -2955,7 +2964,7 @@ explain select * from t where age=5; - By default, Regions are split for a new table when it is being created in TiDB. After this variable is enabled, the newly split Regions are scattered immediately during the execution of the `CREATE TABLE` statement. This applies to the scenario where data need to be written in batches right after the tables are created in batches, because the newly split Regions can be scattered in TiKV beforehand and do not have to wait to be scheduled by PD. To ensure the continuous stability of writing data in batches, the `CREATE TABLE` statement returns success only after the Regions are successfully scattered. This makes the statement's execution time multiple times longer than that when you disable this variable. - Note that if `SHARD_ROW_ID_BITS` and `PRE_SPLIT_REGIONS` have been set when a table is created, the specified number of Regions are evenly split after the table creation. -### `tidb_shard_allocate_step` New in v5.0 +### tidb_shard_allocate_step New in v5.0 - Scope: SESSION | GLOBAL - Persists to cluster: Yes @@ -2963,6 +2972,14 @@ explain select * from t where age=5; - Range: `[1, 9223372036854775807]` - This variable controls the maximum number of continuous IDs to be allocated for the [`AUTO_RANDOM`](/auto-random.md) or [`SHARD_ROW_ID_BITS`](/shard-row-id-bits.md) attribute. Generally, `AUTO_RANDOM` IDs or the `SHARD_ROW_ID_BITS` annotated row IDs are incremental and continuous in one transaction. You can use this variable to solve the hotspot issue in large transaction scenarios. +### tidb_simplified_metrics + +- Scope: GLOBAL +- Persists to cluster: Yes +- Type: Boolean +- Default value: `OFF` +- When this variable is enabled, TiDB does not collect or record the metrics that are not used in the Grafana panels. + ### tidb_skip_ascii_check New in v5.0 - Scope: SESSION | GLOBAL From bf74f6e12d3434cf9a6d933c8fa5a2b0d35e1c1e Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Sun, 9 Oct 2022 17:53:38 +0800 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: shichun-0415 <89768198+shichun-0415@users.noreply.github.com> --- system-variables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index d85b1e6842996..84652d44a139b 100644 --- a/system-variables.md +++ b/system-variables.md @@ -166,7 +166,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Default value: `utf8mb4_bin` -- The default collation for a database when the database is created. +- The default collation used when the database is created. ### cte_max_recursion_depth @@ -266,7 +266,7 @@ For more possible values of this variable, see [Authentication plugin status](/s - Default value: (system hostname) - The hostname of the TiDB server as a read-only variable. -### identity +### identity New in v5.3.0 This variable is an alias for [`last_insert_id`](#last_insert_id). From 034650e77e16eaa6521e967b77231d44f9fcbfc2 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:03:23 +0800 Subject: [PATCH 3/3] Update system-variables.md --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 84652d44a139b..983966ef3b3b0 100644 --- a/system-variables.md +++ b/system-variables.md @@ -159,7 +159,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Default value: `utf8mb4_bin` -- This variable indicates the collation of the default database in use. **It is NOT recommended to set this variable**. When a new default database is selected, the server changes the variable value. +- This variable indicates the default collation of the database in use. **It is NOT recommended to set this variable**. When a new database is selected, TiDB changes this variable value. ### collation_server