| title | TiDB Limitations |
|---|---|
| summary | Learn the usage limitations of TiDB. |
This document describes the common usage limitations of TiDB, including the maximum identifier length and the maximum number of supported databases, tables, indexes, partitioned tables, and sequences.
Note:
TiDB offers high compatibility with the MySQL protocol and syntax, including many MySQL limitations. For example, a single index can include a maximum of 16 columns. For more information, see MySQL Compatibility and the official MySQL documentation.
| Identifier type | Maximum length (number of characters allowed) |
|---|---|
| Database | 64 |
| Table | 64 |
| Column | 64 |
| Index | 64 |
| View | 64 |
| Sequence | 64 |
| Type | Maximum number |
|---|---|
| Databases | unlimited |
| Tables | unlimited |
| Views | unlimited |
| Connections | unlimited |
| Type | Upper limit |
|---|---|
| Tables | unlimited |
| Type | Upper limit (default value) |
|---|---|
| Columns | Defaults to 1017 and can be adjusted up to 4096 |
| Indexes | Defaults to 64 and can be adjusted up to 512 |
| Rows | unlimited |
| Size | unlimited |
| Partitions | 8192 |
- The upper limit of
Columnscan be modified viatable-column-count-limit. - The upper limit of
Indexescan be modified viaindex-limit.
| Type | Upper limit (default value) |
|---|---|
| Size | Defaults to 6 MiB and can be adjusted to 120 MiB |
You can adjust the size limit via the txn-entry-size-limit configuration item.
The maximum index length is 3072 bytes, equivalent to 768 characters using 4-byte UTF-8 encoding. The maximum number of columns in a single index is limited to 16.
You can adjust this limit using the max-index-length configuration item.
| Type | Upper limit |
|---|---|
| CHAR | 255 characters |
| BINARY | 255 bytes |
| VARBINARY | 65535 bytes |
| VARCHAR | 16383 characters |
| TEXT | 65535 bytes |
| BLOB | 65535 bytes |
| Type | Upper limit |
|---|---|
| The maximum number of SQL statements in a single transaction | When the optimistic transaction is used and the transaction retry is enabled, the upper limit is 5000. |
You can modify the limit via the stmt-count-limit configuration item.
In your cluster, if the version of the TiDB component is v6.2.0 or later, the version of TiKV must be v6.2.0 or later.