Skip to content

feat: txn limit shift to 1TB #15247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion develop/dev-guide-transaction-restraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down