From 6c39e9816de0ef10a2e39fa9d21d38f618dd1bf9 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Mon, 10 Oct 2022 12:55:49 +0800 Subject: [PATCH] sysvar: add 2 sysvars (#10662) (#10698) --- system-variables.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/system-variables.md b/system-variables.md index 209b88f80c917..abeda913d87b1 100644 --- a/system-variables.md +++ b/system-variables.md @@ -151,21 +151,21 @@ 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 - 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 - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Default value: `utf8mb4_bin` -- The default collation for the server. +- The default collation used when the database is created. ### cte_max_recursion_depth @@ -265,9 +265,9 @@ 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`. +This variable is an alias for [`last_insert_id`](#last_insert_id). ### init_connect @@ -396,6 +396,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 @@ -2954,7 +2963,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 @@ -2962,6 +2971,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