diff --git a/develop/dev-guide-transaction-restraints.md b/develop/dev-guide-transaction-restraints.md index 6c180e6d29bf6..fdc4d650c629d 100644 --- a/develop/dev-guide-transaction-restraints.md +++ b/develop/dev-guide-transaction-restraints.md @@ -710,7 +710,11 @@ mysql> SELECT * FROM T2; The basic principle is to limit the size of the transaction. At the KV level, TiDB has a restriction on the size of a single transaction. At the SQL level, one row of data is mapped to one KV entry, and each additional index will add one KV entry. The restriction is as follows at the SQL level: - The maximum single row record size is `120 MB`. You can configure it by `performance.txn-entry-size-limit` for TiDB v5.0 and later versions. The value is `6 MB` for earlier versions. -- The maximum single transaction size supported is `10 GB`. You can configure it by `performance.txn-total-size-limit` for TiDB v4.0 and later versions. The value is `100 MB` for earlier versions. +- The size of transactions is influenced by different parameters in different versions. + + - In versions below TiDB v4.0, the maximum capacity of a single transaction is `100 MB`. + - In TiDB v4.0 and higher versions, you can adjust it via the tidb-server configuration option [`performance.txn-total-size-limit`](/tidb-configuration-file.md#txn-total-size-limit), with a default value of `100 MB` and a maximum limit of `1 TB`. + - In TiDB v6.5 and higher versions, the maximum capacity of a single transaction is controlled by [memory control](/configure-memory-usage.md) by default. If you manually set `performance.txn-total-size-limit`, you can control the transaction size to a maximum of `1 TB`. Note that for both the size restrictions and row restrictions, you should also consider the overhead of encoding and additional keys for the transaction during the transaction execution. To achieve optimal performance, it is recommended to write one transaction every 100 ~ 500 rows.