Skip to content
Merged
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
10 changes: 2 additions & 8 deletions faq/tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ The character sets of TiDB use UTF-8 by default and currently only support UTF-8

32 characters at most.

#### What is the maximum number of statements in a transaction?

5000 at most.

#### Does TiDB support XA?

No. The JDBC driver of TiDB is MySQL JDBC (Connector/J). When using Atomikos, set the data source to `type="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"`. TiDB does not support the connection with MySQL JDBC XADataSource. MySQL JDBC XADataSource only works for MySQL (for example, using DML to modify the `redo` log).
Expand Down Expand Up @@ -930,11 +926,9 @@ The total read capacity has no limit. You can increase the read capacity by addi

#### The error message `transaction too large` is displayed

As distributed transactions need to conduct two-phase commit and the bottom layer performs Raft replication, if a transaction is very large, the commit process would be quite slow and the following Raft replication flow is thus struck. To avoid this problem, we limit the transaction size:
Due to the limitation of the underlying storage engine, each key-value entry (one row) in TiDB should be no more than 6MB.

- A transaction is limited to 5000 SQL statements (by default)
- Each Key-Value entry is no more than 6MB
- The total size of Key-Value entry is no more than 100MB
Distributed transactions need two-phase commit and the underlying implementation performs the Raft replication. If a transaction is very large, the commit process would be quite slow and this transaction is more likely to conflict with other transactions. Moreover, the rollback of a failed transaction leads to an unnecessary performance penalty. To avoid these problems, we limit the total size of key-value entries to no more than 100MB in a transaction by default. If you need larger transactions, change `txn-total-size-limit` in the TiDB configuration file. The maximum value of this configuration item is up to `10G`. The actual limitation might also depend on the hardware of the RAM.

There are [similar limits](https://cloud.google.com/spanner/docs/limits) on Google Cloud Spanner.

Expand Down