diff --git a/system-variables.md b/system-variables.md index bee298ff03cb2..85b70f10bc985 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2938,6 +2938,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 and v7.3.0 + +- 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`, these keys are not 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 behavior without locks 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