From 8e6ab68056643c63fbdba256502e48f3a62e201a Mon Sep 17 00:00:00 2001 From: Aolin Date: Fri, 14 Jul 2023 10:32:35 +0800 Subject: [PATCH] system variable: add tidb_lock_unchanged_keys Signed-off-by: Aolin --- system-variables.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system-variables.md b/system-variables.md index fa199a6963947..3e9534493890a 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2797,6 +2797,17 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified +### `tidb_lock_unchanged_keys` New in v7.1.1 + +- Scope: SESSION | GLOBAL +- Persists to cluster: Yes +- Type: Boolean +- Default value: `ON` +- This variable is used to control whether to lock specific keys in the following scenarios. When the value is set to `ON`, these keys are locked. When the value is set to `OFF`, no keys are locked. + - Duplicate keys in `INSERT IGNORE` and `REPLACE` statements. Before v6.1.6, these keys were not locked. This issue has been fixed in [#42121](https://github.com/pingcap/tidb/issues/42121). + - Unique keys in `UPDATE` statements when the values of the keys are not changed. Before v6.5.2, these keys were not locked. This issue has been fixed in [#36438](https://github.com/pingcap/tidb/issues/36438). +- To maintain the consistency and rationality of the transaction, it is not recommended to change this value. If upgrading TiDB causes severe performance issues due to these two fixes, and the unlocked behavior is acceptable (see the preceding issues), you can set this variable to `OFF`. + ### tidb_log_file_max_days New in v5.3.0 - Scope: GLOBAL