From 1a650c67441e03c3c907bf349e7de13ebd216337 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Wed, 3 Aug 2022 11:14:00 +0800 Subject: [PATCH 01/30] fix ci --- system-variables.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/system-variables.md b/system-variables.md index c889c6a38129d..d0dde7946ca7a 100644 --- a/system-variables.md +++ b/system-variables.md @@ -334,6 +334,16 @@ This variable is an alias for `last_insert_id`. > > Unlike in MySQL, the `max_execution_time` system variable currently works on all kinds of statements in TiDB, not only restricted to the `SELECT` statement. The precision of the timeout value is roughly 100ms. This means the statement might not be terminated in accurate milliseconds as you specify. +### max_prepared_stmt_count + +- Scope: GLOBAL +- Persists to cluster: Yes +- Type: Integer +- Default value: `-1` +- Range: `[-1, 1048576]` +- Indicates the maximum number of [`PREPARE` statement](/sql-statements/sql-statement-prepare.md) of a session. +- `-1` means no limitation. + ### plugin_dir - Scope: GLOBAL @@ -1060,6 +1070,15 @@ Constraint checking is always performed in place for pessimistic transactions (d - Since v6.1.0, the [Join Reorder](/join-reorder.md) algorithm of TiDB supports Outer Join. This variable controls the support behavior, and the default value is `ON`. - For a cluster upgraded from a version earlier than v6.1.0, the default value is still `TRUE`. +### tidb_enable_ordered_result_mode + +- Scope: SESSION | GLOBAL +- Persists to cluster: Yes +- Default value: `OFF` +- Indicates whether to sort the final output result automatically. +- For example, if enable this feature, TiDB will process `select a, max(b) from t group by a` as `select a, max(b) from t group by a order by a, max(b)`. + + ### tidb_enable_paging New in v5.4.0 - Scope: SESSION | GLOBAL @@ -1753,6 +1772,16 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - This variable is used to set whether the optimizer executes the optimization operation of pushing down the aggregate function to the position before Join, Projection, and UnionAll. - When the aggregate operation is slow in query, you can set the variable value to ON. +### tidb_opt_cartesian_bcj + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Integer +- Default value: `1` +- Range: `[0, 2]` +- Indicates whether to allow broadcast CARTESIAN join. +- `0` means that it's not allowed, `1` means that it's allow based on `tidb_broadcast_join_threshold_count`, and `2` means it's always allowed even if the table size exceeds the threshold. + ### tidb_opt_correlation_exp_factor - Scope: SESSION | GLOBAL From b9697d600d2ed5b59073da6708b13047cc2d8b5d Mon Sep 17 00:00:00 2001 From: qw4990 Date: Thu, 11 Aug 2022 18:51:03 +0800 Subject: [PATCH 02/30] fixup --- system-variables.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system-variables.md b/system-variables.md index d0dde7946ca7a..c811f1b59e16d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1782,6 +1782,14 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Indicates whether to allow broadcast CARTESIAN join. - `0` means that it's not allowed, `1` means that it's allow based on `tidb_broadcast_join_threshold_count`, and `2` means it's always allowed even if the table size exceeds the threshold. +### tidb_opt_concurrency_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Default value: `` + + ### tidb_opt_correlation_exp_factor - Scope: SESSION | GLOBAL From 6aac2cf2097734357aca520280cff124e105b4ef Mon Sep 17 00:00:00 2001 From: qw4990 Date: Thu, 11 Aug 2022 19:10:44 +0800 Subject: [PATCH 03/30] fixup --- system-variables.md | 75 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index c811f1b59e16d..272aa034b5206 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1787,8 +1787,18 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Scope: SESSION | GLOBAL - Persists to cluster: YES - Type: Float -- Default value: `` +- Range: `[0, 2147483647]` +- Default value: `3.0` +- Indicates the CPU cost of a Golang goroutine in TiDB. It's used by the [Cost Model](/cost-model.md). + +### tidb_opt_cop_cpu_factor +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `3.0` +- Indicates the CPU cost of TiKV Coprocessor to process one row. It's used by the [Cost Model](/cost-model.md). ### tidb_opt_correlation_exp_factor @@ -1812,6 +1822,33 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Range: `[0, 1]` - This variable is used to set the threshold value that determines whether to enable estimating the row count by using column order correlation. If the order correlation between the current column and the `handle` column exceeds the threshold value, this method is enabled. +### tidb_opt_cop_cpu_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `3.0` +- Indicates the CPU cost of TiDB to process one row. It's used by the [Cost Model](/cost-model.md). + +### tidb_opt_desc_scan_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `3.0` +- Indicates the cost of TiKV to scan one row in descending order. It's used by the [Cost Model](/cost-model.md). + +### tidb_opt_disk_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `1.5` +- Indicates the I/O cost of TiDB to read/write one byte from/to temporary disk. It's used by the [Cost Model](/cost-model.md). + ### tidb_opt_distinct_agg_push_down - Scope: SESSION @@ -1891,6 +1928,15 @@ mysql> desc select count(distinct a) from test.t; - This variable is used to set the threshold that determines whether to push the Limit or TopN operator down to TiKV. - If the value of the Limit or TopN operator is smaller than or equal to this threshold, these operators are forcibly pushed down to TiKV. This variable resolves the issue that the Limit or TopN operator cannot be pushed down to TiKV partly due to wrong estimation. +### tidb_opt_memory_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `0.001` +- Indicates the memory cost of TiDB to store one row. It's used by the [Cost Model](/cost-model.md). + ### tidb_opt_mpp_outer_join_fixed_build_side New in v5.1.0 - Scope: SESSION | GLOBAL @@ -1899,6 +1945,15 @@ mysql> desc select count(distinct a) from test.t; - Default value: `ON` - When the variable value is `ON`, the left join operator always uses inner table as the build side and the right join operator always uses outer table as the build side. If you set the value to `OFF`, the outer join operator can use either side of the tables as the build side. +### tidb_opt_network_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `1.0` +- Indicates the net cost of transferring 1 byte through the network. It's used by the [Cost Model](/cost-model.md). + ### tidb_opt_prefer_range_scan New in v5.0 - Scope: SESSION | GLOBAL @@ -1940,6 +1995,24 @@ explain select * from t where age=5; - Default value: `OFF` - Specifies whether to allow the optimizer to push `Projection` down to the TiKV or TiFlash coprocessor. +### tidb_opt_scan_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `1.5` +- Indicates the cost of TiKV to scan one row in ascending order. It's used by the [Cost Model](/cost-model.md). + +### tidb_opt_seek_factor + +- Scope: SESSION | GLOBAL +- Persists to cluster: YES +- Type: Float +- Range: `[0, 2147483647]` +- Default value: `20` +- Indicates the start-up cost of TiDB to request data from TiKV. It's used by the [Cost Model](/cost-model.md). + ### tidb_opt_skew_distinct_agg New in v6.2.0 > **Note:** From 32ebb9c41fee81f8b98fac59133fc988cda598eb Mon Sep 17 00:00:00 2001 From: qw4990 Date: Thu, 11 Aug 2022 19:14:02 +0800 Subject: [PATCH 04/30] fixup --- system-variables.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system-variables.md b/system-variables.md index 272aa034b5206..7f82f54c2aab8 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1789,7 +1789,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost of a Golang goroutine in TiDB. It's used by the [Cost Model](/cost-model.md). +- Indicates the CPU cost of starting a Golang goroutine in TiDB. It's used by the [Cost Model](/cost-model.md). ### tidb_opt_cop_cpu_factor @@ -1822,7 +1822,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Range: `[0, 1]` - This variable is used to set the threshold value that determines whether to enable estimating the row count by using column order correlation. If the order correlation between the current column and the `handle` column exceeds the threshold value, this method is enabled. -### tidb_opt_cop_cpu_factor +### tidb_opt_cpu_factor - Scope: SESSION | GLOBAL - Persists to cluster: YES @@ -1838,7 +1838,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the cost of TiKV to scan one row in descending order. It's used by the [Cost Model](/cost-model.md). +- Indicates the cost of TiKV to scan one row from the disk in descending order. It's used by the [Cost Model](/cost-model.md). ### tidb_opt_disk_factor @@ -1847,7 +1847,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the I/O cost of TiDB to read/write one byte from/to temporary disk. It's used by the [Cost Model](/cost-model.md). +- Indicates the I/O cost of TiDB to read/write one byte from/to the temporary disk. It's used by the [Cost Model](/cost-model.md). ### tidb_opt_distinct_agg_push_down @@ -2002,7 +2002,7 @@ explain select * from t where age=5; - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the cost of TiKV to scan one row in ascending order. It's used by the [Cost Model](/cost-model.md). +- Indicates the cost of TiKV to scan one row from the disk in ascending order. It's used by the [Cost Model](/cost-model.md). ### tidb_opt_seek_factor From 969dbcb4f24111bfb7ba1ba75a69b36dae88138c Mon Sep 17 00:00:00 2001 From: qw4990 Date: Mon, 15 Aug 2022 16:47:54 +0800 Subject: [PATCH 05/30] address comments --- system-variables.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 7f82f54c2aab8..7904db2222ed0 100644 --- a/system-variables.md +++ b/system-variables.md @@ -343,6 +343,28 @@ This variable is an alias for `last_insert_id`. - Range: `[-1, 1048576]` - Indicates the maximum number of [`PREPARE` statement](/sql-statements/sql-statement-prepare.md) of a session. - `-1` means no limitation. +- If you set it to a value that exceeds the maximum number, `1048576` will be used: + +```sql +mysql> set global max_prepared_stmt_count=1048577; +Query OK, 0 rows affected, 1 warning (0.01 sec) + +mysql> show warnings; ++---------+------+--------------------------------------------------------------+ +| Level | Code | Message | ++---------+------+--------------------------------------------------------------+ +| Warning | 1292 | Truncated incorrect max_prepared_stmt_count value: '1048577' | ++---------+------+--------------------------------------------------------------+ +1 row in set (0.00 sec) + +mysql> show global variables like 'max_prepared_stmt_count'; ++-------------------------+---------+ +| Variable_name | Value | ++-------------------------+---------+ +| max_prepared_stmt_count | 1048576 | ++-------------------------+---------+ +1 row in set (0.00 sec) +``` ### plugin_dir @@ -1780,7 +1802,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Default value: `1` - Range: `[0, 2]` - Indicates whether to allow broadcast CARTESIAN join. -- `0` means that it's not allowed, `1` means that it's allow based on `tidb_broadcast_join_threshold_count`, and `2` means it's always allowed even if the table size exceeds the threshold. +- `0` means that it's not allowed, `1` means that it's allowed based on `tidb_broadcast_join_threshold_count`, and `2` means it's always allowed even if the table size exceeds the threshold. ### tidb_opt_concurrency_factor From 2e2886927056833c4a4ab95e69f63668f3d29438 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:23:41 +0800 Subject: [PATCH 06/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 7904db2222ed0..d3401d75968fd 100644 --- a/system-variables.md +++ b/system-variables.md @@ -342,7 +342,7 @@ This variable is an alias for `last_insert_id`. - Default value: `-1` - Range: `[-1, 1048576]` - Indicates the maximum number of [`PREPARE` statement](/sql-statements/sql-statement-prepare.md) of a session. -- `-1` means no limitation. +- The value of `-1` means no limit on the maximum number of `PREPARE` statements in a session. - If you set it to a value that exceeds the maximum number, `1048576` will be used: ```sql From f33ee3f63db39579620cb406e05002d452482927 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:23:50 +0800 Subject: [PATCH 07/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 1 - 1 file changed, 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index d3401d75968fd..fc527c5a47ee8 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1100,7 +1100,6 @@ Constraint checking is always performed in place for pessimistic transactions (d - Indicates whether to sort the final output result automatically. - For example, if enable this feature, TiDB will process `select a, max(b) from t group by a` as `select a, max(b) from t group by a order by a, max(b)`. - ### tidb_enable_paging New in v5.4.0 - Scope: SESSION | GLOBAL From a7e924115eda6ad4f3c9103898a051bea010fc38 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:23:57 +0800 Subject: [PATCH 08/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index fc527c5a47ee8..acb45c1edeb61 100644 --- a/system-variables.md +++ b/system-variables.md @@ -341,7 +341,7 @@ This variable is an alias for `last_insert_id`. - Type: Integer - Default value: `-1` - Range: `[-1, 1048576]` -- Indicates the maximum number of [`PREPARE` statement](/sql-statements/sql-statement-prepare.md) of a session. +- Specifies the maximum number of [`PREPARE`](/sql-statements/sql-statement-prepare.md) statements in a session. - The value of `-1` means no limit on the maximum number of `PREPARE` statements in a session. - If you set it to a value that exceeds the maximum number, `1048576` will be used: From 70bbffceac112f7d1d20fc9573016c8bb10f5344 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:04 +0800 Subject: [PATCH 09/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index acb45c1edeb61..4caf2c87161b0 100644 --- a/system-variables.md +++ b/system-variables.md @@ -343,7 +343,7 @@ This variable is an alias for `last_insert_id`. - Range: `[-1, 1048576]` - Specifies the maximum number of [`PREPARE`](/sql-statements/sql-statement-prepare.md) statements in a session. - The value of `-1` means no limit on the maximum number of `PREPARE` statements in a session. -- If you set it to a value that exceeds the maximum number, `1048576` will be used: +- If you set the variable to a value that exceeds the upper limit `1048576`, `1048576` is used instead: ```sql mysql> set global max_prepared_stmt_count=1048577; From d51f3d74088d2099ccb82eb0a47ca9705d8f1798 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:10 +0800 Subject: [PATCH 10/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 4caf2c87161b0..fad6c6010c3b5 100644 --- a/system-variables.md +++ b/system-variables.md @@ -346,7 +346,7 @@ This variable is an alias for `last_insert_id`. - If you set the variable to a value that exceeds the upper limit `1048576`, `1048576` is used instead: ```sql -mysql> set global max_prepared_stmt_count=1048577; +mysql> SET GLOBAL max_prepared_stmt_count=1048577; Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> show warnings; From fc2c7cc83ba37550e7cef517f6d0e0800006b871 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:16 +0800 Subject: [PATCH 11/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index fad6c6010c3b5..a1190b77f0561 100644 --- a/system-variables.md +++ b/system-variables.md @@ -349,7 +349,7 @@ This variable is an alias for `last_insert_id`. mysql> SET GLOBAL max_prepared_stmt_count=1048577; Query OK, 0 rows affected, 1 warning (0.01 sec) -mysql> show warnings; +mysql> SHOW WARNINGS; +---------+------+--------------------------------------------------------------+ | Level | Code | Message | +---------+------+--------------------------------------------------------------+ From 00ea6faa63060bb4679017350edaa756142eb9d7 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:21 +0800 Subject: [PATCH 12/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index a1190b77f0561..766140ed81a9b 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1973,7 +1973,7 @@ mysql> desc select count(distinct a) from test.t; - Type: Float - Range: `[0, 2147483647]` - Default value: `1.0` -- Indicates the net cost of transferring 1 byte through the network. It's used by the [Cost Model](/cost-model.md). +- Indicates the net cost of transferring 1 byte of data through the network. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_prefer_range_scan New in v5.0 From f7da2aef88956faee5e571cfffdd1ff7c188f896 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:28 +0800 Subject: [PATCH 13/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 766140ed81a9b..138a62fcd9522 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2023,7 +2023,7 @@ explain select * from t where age=5; - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the cost of TiKV to scan one row from the disk in ascending order. It's used by the [Cost Model](/cost-model.md). +- Indicates the cost for TiKV to scan one row of data from the disk in ascending order. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_seek_factor From 770e25c2270aad3932369b46b8e1fadba035c7f9 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:33 +0800 Subject: [PATCH 14/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 138a62fcd9522..4b7cc19d77358 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2032,7 +2032,7 @@ explain select * from t where age=5; - Type: Float - Range: `[0, 2147483647]` - Default value: `20` -- Indicates the start-up cost of TiDB to request data from TiKV. It's used by the [Cost Model](/cost-model.md). +- Indicates the start-up cost for TiDB to request data from TiKV. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_skew_distinct_agg New in v6.2.0 From bcff9ed1b93f783ba042e60f0529da231089ab55 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:41 +0800 Subject: [PATCH 15/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 4b7cc19d77358..9acba959ea60f 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1097,7 +1097,7 @@ Constraint checking is always performed in place for pessimistic transactions (d - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Default value: `OFF` -- Indicates whether to sort the final output result automatically. +- Specifies whether to sort the final output result automatically. - For example, if enable this feature, TiDB will process `select a, max(b) from t group by a` as `select a, max(b) from t group by a order by a, max(b)`. ### tidb_enable_paging New in v5.4.0 From 2bafed3b0d4a460a592af17c0a4dd6e451b97c18 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:24:51 +0800 Subject: [PATCH 16/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 9acba959ea60f..2ea3ea21a1a54 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1098,7 +1098,7 @@ Constraint checking is always performed in place for pessimistic transactions (d - Persists to cluster: Yes - Default value: `OFF` - Specifies whether to sort the final output result automatically. -- For example, if enable this feature, TiDB will process `select a, max(b) from t group by a` as `select a, max(b) from t group by a order by a, max(b)`. +- For example, with this variable enabled, TiDB processes `SELECT a, MAX(b) FROM t GROUP BY a` as `SELECT a, MAX(b) FROM t GROUP BY a ORDER BY a, MAX(b)`. ### tidb_enable_paging New in v5.4.0 From 6755c0a99d121a80a5c897c0d5567091f4a0ecae Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:25:01 +0800 Subject: [PATCH 17/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 2ea3ea21a1a54..0fd1caf2d334e 100644 --- a/system-variables.md +++ b/system-variables.md @@ -357,7 +357,7 @@ mysql> SHOW WARNINGS; +---------+------+--------------------------------------------------------------+ 1 row in set (0.00 sec) -mysql> show global variables like 'max_prepared_stmt_count'; +mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count'; +-------------------------+---------+ | Variable_name | Value | +-------------------------+---------+ From 74743770e9916c6ad912bd6064d2129b1a0420aa Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:25:16 +0800 Subject: [PATCH 18/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 0fd1caf2d334e..6e82cef8d41b8 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1800,7 +1800,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Integer - Default value: `1` - Range: `[0, 2]` -- Indicates whether to allow broadcast CARTESIAN join. +- Indicates whether to allow the broadcast CARTESIAN join. - `0` means that it's not allowed, `1` means that it's allowed based on `tidb_broadcast_join_threshold_count`, and `2` means it's always allowed even if the table size exceeds the threshold. ### tidb_opt_concurrency_factor From 8c541fa8181f8b7e5271016850b3fb40e79a429f Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:25:25 +0800 Subject: [PATCH 19/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 6e82cef8d41b8..93ce4b9e4208d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1801,7 +1801,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Default value: `1` - Range: `[0, 2]` - Indicates whether to allow the broadcast CARTESIAN join. -- `0` means that it's not allowed, `1` means that it's allowed based on `tidb_broadcast_join_threshold_count`, and `2` means it's always allowed even if the table size exceeds the threshold. +- `0` means that the broadcast CARTESIAN join is not allowed. `1` means that it is allowed based on [`tidb_broadcast_join_threshold_count`](#tidb_broadcast_join_threshold_count-new-in-v50). `2` means that it is always allowed even if the table size exceeds the threshold. ### tidb_opt_concurrency_factor From ac6a4d762d89d0cd2aa9df39c460bdf864402267 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:25:34 +0800 Subject: [PATCH 20/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 93ce4b9e4208d..406f59763f919 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1810,7 +1810,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost of starting a Golang goroutine in TiDB. It's used by the [Cost Model](/cost-model.md). +- Indicates the CPU cost of starting a Golang goroutine in TiDB. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_cop_cpu_factor From 1fde1635170957fe27649ff8d937e5e4707a0899 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:25:45 +0800 Subject: [PATCH 21/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 406f59763f919..e04c9170bcc16 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1819,7 +1819,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost of TiKV Coprocessor to process one row. It's used by the [Cost Model](/cost-model.md). +- Indicates the CPU cost for TiKV Coprocessor to process one row. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_correlation_exp_factor From acf3a2756b6c83e4f5a1ba2a09f7ee3482633a54 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:25:57 +0800 Subject: [PATCH 22/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index e04c9170bcc16..9c34abce6552c 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1868,7 +1868,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the I/O cost of TiDB to read/write one byte from/to the temporary disk. It's used by the [Cost Model](/cost-model.md). +- Indicates the I/O cost for TiDB to read or write one byte of data from or to the temporary disk. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_distinct_agg_push_down From 5b13f580111ff86daff9aa951d3acb013dd9b81b Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:26:11 +0800 Subject: [PATCH 23/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 9c34abce6552c..21b18fc99e1d6 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1956,7 +1956,7 @@ mysql> desc select count(distinct a) from test.t; - Type: Float - Range: `[0, 2147483647]` - Default value: `0.001` -- Indicates the memory cost of TiDB to store one row. It's used by the [Cost Model](/cost-model.md). +- Indicates the memory cost for TiDB to store one row. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_mpp_outer_join_fixed_build_side New in v5.1.0 From 623c1ec6e0ca00674bca889e6ed7ccd67353987f Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:26:19 +0800 Subject: [PATCH 24/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 21b18fc99e1d6..37f167d2ab794 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1850,7 +1850,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost of TiDB to process one row. It's used by the [Cost Model](/cost-model.md). +- Indicates the CPU cost for TiDB to process one row. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_desc_scan_factor From e2aea102a318d8a85bc53509c1b9453cc427745a Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Tue, 16 Aug 2022 15:26:28 +0800 Subject: [PATCH 25/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 37f167d2ab794..637da6e703060 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1859,7 +1859,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the cost of TiKV to scan one row from the disk in descending order. It's used by the [Cost Model](/cost-model.md). +- Indicates the cost for TiKV to scan one row from the disk in descending order. This variable is internally used in the [Cost Model](/cost-model.md). ### tidb_opt_disk_factor From a92aa2b2b6cbcf4d9cbf57af09f6cc115021f500 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Tue, 16 Aug 2022 16:50:50 +0800 Subject: [PATCH 26/30] Apply suggestions from code review --- system-variables.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/system-variables.md b/system-variables.md index 637da6e703060..1cd4ebc3a3f0d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1802,6 +1802,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Range: `[0, 2]` - Indicates whether to allow the broadcast CARTESIAN join. - `0` means that the broadcast CARTESIAN join is not allowed. `1` means that it is allowed based on [`tidb_broadcast_join_threshold_count`](#tidb_broadcast_join_threshold_count-new-in-v50). `2` means that it is always allowed even if the table size exceeds the threshold. +- This variable is internally used in TiDB, and it is not recommended to modify its value. ### tidb_opt_concurrency_factor @@ -1810,7 +1811,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost of starting a Golang goroutine in TiDB. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the CPU cost of starting a Golang goroutine in TiDB. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_cop_cpu_factor @@ -1819,7 +1820,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost for TiKV Coprocessor to process one row. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the CPU cost for TiKV Coprocessor to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_correlation_exp_factor @@ -1850,7 +1851,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost for TiDB to process one row. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the CPU cost for TiDB to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_desc_scan_factor @@ -1859,7 +1860,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the cost for TiKV to scan one row from the disk in descending order. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the cost for TiKV to scan one row from the disk in descending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_disk_factor @@ -1868,7 +1869,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the I/O cost for TiDB to read or write one byte of data from or to the temporary disk. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the I/O cost for TiDB to read or write one byte of data from or to the temporary disk. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_distinct_agg_push_down @@ -1956,7 +1957,7 @@ mysql> desc select count(distinct a) from test.t; - Type: Float - Range: `[0, 2147483647]` - Default value: `0.001` -- Indicates the memory cost for TiDB to store one row. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the memory cost for TiDB to store one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_mpp_outer_join_fixed_build_side New in v5.1.0 @@ -1973,7 +1974,7 @@ mysql> desc select count(distinct a) from test.t; - Type: Float - Range: `[0, 2147483647]` - Default value: `1.0` -- Indicates the net cost of transferring 1 byte of data through the network. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the net cost of transferring 1 byte of data through the network. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_prefer_range_scan New in v5.0 @@ -2023,7 +2024,7 @@ explain select * from t where age=5; - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the cost for TiKV to scan one row of data from the disk in ascending order. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the cost for TiKV to scan one row of data from the disk in ascending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_seek_factor @@ -2032,7 +2033,7 @@ explain select * from t where age=5; - Type: Float - Range: `[0, 2147483647]` - Default value: `20` -- Indicates the start-up cost for TiDB to request data from TiKV. This variable is internally used in the [Cost Model](/cost-model.md). +- Indicates the start-up cost for TiDB to request data from TiKV. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. ### tidb_opt_skew_distinct_agg New in v6.2.0 From e286d60807de5012c78f3c5a973e6ddf338701d7 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Tue, 16 Aug 2022 17:58:34 +0800 Subject: [PATCH 27/30] 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 1cd4ebc3a3f0d..1f0b0e4835569 100644 --- a/system-variables.md +++ b/system-variables.md @@ -341,7 +341,7 @@ This variable is an alias for `last_insert_id`. - Type: Integer - Default value: `-1` - Range: `[-1, 1048576]` -- Specifies the maximum number of [`PREPARE`](/sql-statements/sql-statement-prepare.md) statements in a session. +- Specifies the maximum number of [`PREPARE`](/sql-statements/sql-statement-prepare.md) statements in a session. - The value of `-1` means no limit on the maximum number of `PREPARE` statements in a session. - If you set the variable to a value that exceeds the upper limit `1048576`, `1048576` is used instead: From 1573e64595255012c91ced12d6df9460169d3f35 Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Wed, 17 Aug 2022 12:31:27 +0800 Subject: [PATCH 28/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 1f0b0e4835569..14e8313a944f0 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1801,7 +1801,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Default value: `1` - Range: `[0, 2]` - Indicates whether to allow the broadcast CARTESIAN join. -- `0` means that the broadcast CARTESIAN join is not allowed. `1` means that it is allowed based on [`tidb_broadcast_join_threshold_count`](#tidb_broadcast_join_threshold_count-new-in-v50). `2` means that it is always allowed even if the table size exceeds the threshold. +- `0` means that the Broadcast Cartesian Join is not allowed. `1` means that it is allowed based on [`tidb_broadcast_join_threshold_count`](#tidb_broadcast_join_threshold_count-new-in-v50). `2` means that it is always allowed even if the table size exceeds the threshold. - This variable is internally used in TiDB, and it is not recommended to modify its value. ### tidb_opt_concurrency_factor From 0c0785f6f2899add33d49a3cdb3a7b3dc16fb77e Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Wed, 17 Aug 2022 12:31:33 +0800 Subject: [PATCH 29/30] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 14e8313a944f0..6079f44eb67a6 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1800,7 +1800,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Integer - Default value: `1` - Range: `[0, 2]` -- Indicates whether to allow the broadcast CARTESIAN join. +- Indicates whether to allow the Broadcast Cartesian Join. - `0` means that the Broadcast Cartesian Join is not allowed. `1` means that it is allowed based on [`tidb_broadcast_join_threshold_count`](#tidb_broadcast_join_threshold_count-new-in-v50). `2` means that it is always allowed even if the table size exceeds the threshold. - This variable is internally used in TiDB, and it is not recommended to modify its value. From d662fd31d013fbbf98a9300c166a97e8e0fa0049 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 18 Aug 2022 15:19:58 +0800 Subject: [PATCH 30/30] Apply suggestions from code review Co-authored-by: Aolin --- system-variables.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/system-variables.md b/system-variables.md index 6079f44eb67a6..18f7c5d7e4eaf 100644 --- a/system-variables.md +++ b/system-variables.md @@ -346,7 +346,7 @@ This variable is an alias for `last_insert_id`. - If you set the variable to a value that exceeds the upper limit `1048576`, `1048576` is used instead: ```sql -mysql> SET GLOBAL max_prepared_stmt_count=1048577; +mysql> SET GLOBAL max_prepared_stmt_count = 1048577; Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> SHOW WARNINGS; @@ -1802,7 +1802,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Range: `[0, 2]` - Indicates whether to allow the Broadcast Cartesian Join. - `0` means that the Broadcast Cartesian Join is not allowed. `1` means that it is allowed based on [`tidb_broadcast_join_threshold_count`](#tidb_broadcast_join_threshold_count-new-in-v50). `2` means that it is always allowed even if the table size exceeds the threshold. -- This variable is internally used in TiDB, and it is not recommended to modify its value. +- This variable is internally used in TiDB, and it is **NOT** recommended to modify its value. ### tidb_opt_concurrency_factor @@ -1811,7 +1811,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost of starting a Golang goroutine in TiDB. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the CPU cost of starting a Golang goroutine in TiDB. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_cop_cpu_factor @@ -1820,7 +1820,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost for TiKV Coprocessor to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the CPU cost for TiKV Coprocessor to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_correlation_exp_factor @@ -1851,7 +1851,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the CPU cost for TiDB to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the CPU cost for TiDB to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_desc_scan_factor @@ -1860,7 +1860,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `3.0` -- Indicates the cost for TiKV to scan one row from the disk in descending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the cost for TiKV to scan one row from the disk in descending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_disk_factor @@ -1869,7 +1869,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the I/O cost for TiDB to read or write one byte of data from or to the temporary disk. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the I/O cost for TiDB to read or write one byte of data from or to the temporary disk. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_distinct_agg_push_down @@ -1957,7 +1957,7 @@ mysql> desc select count(distinct a) from test.t; - Type: Float - Range: `[0, 2147483647]` - Default value: `0.001` -- Indicates the memory cost for TiDB to store one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the memory cost for TiDB to store one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_mpp_outer_join_fixed_build_side New in v5.1.0 @@ -1974,7 +1974,7 @@ mysql> desc select count(distinct a) from test.t; - Type: Float - Range: `[0, 2147483647]` - Default value: `1.0` -- Indicates the net cost of transferring 1 byte of data through the network. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the net cost of transferring 1 byte of data through the network. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_prefer_range_scan New in v5.0 @@ -2024,7 +2024,7 @@ explain select * from t where age=5; - Type: Float - Range: `[0, 2147483647]` - Default value: `1.5` -- Indicates the cost for TiKV to scan one row of data from the disk in ascending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the cost for TiKV to scan one row of data from the disk in ascending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_seek_factor @@ -2033,7 +2033,7 @@ explain select * from t where age=5; - Type: Float - Range: `[0, 2147483647]` - Default value: `20` -- Indicates the start-up cost for TiDB to request data from TiKV. This variable is internally used in the [Cost Model](/cost-model.md), and it is not recommended to modify its value. +- Indicates the start-up cost for TiDB to request data from TiKV. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. ### tidb_opt_skew_distinct_agg New in v6.2.0