TiDB Limitations

This document describes general usage limits in TiDB, including the maximum length of identifiers and the maximum number of supported databases, tables, indexes, partitioned tables, and sequences.

Identifier Length Limits

Identifier type Maximum length (number of allowed characters)
Database 64
Table 64
Column 64
Index 64
View 64
Sequence 64

Limits on the Total Number of Databases, Tables, Views, and Connections

Identifier type Maximum number
Databases Unlimited
Tables Unlimited
Views Unlimited
Connections Unlimited

Single Database Limits

Type Upper limit
Tables Unlimited

Single Table Limits

Type Upper limit (default)
Columns The default is 1017 and can be adjusted up to 4096.
Indexes The default is 64 and can be adjusted up to 512.
Rows Unlimited
Size Unlimited
Partitions 8192
  • The upper limit for Columns can be changed with table-column-count-limit.
  • The upper limit for Indexes can be changed with index-limit.

Single Row Limits

Type Upper limit
Size 6MB
You can adjust the size limit with the txn-entry-size-limit configuration item.

Single Column Limits

Type Upper limit
Size 6MB

String Type Limits

Type Upper limit
CHAR 256 characters
BINARY 256 characters
VARBINARY 65535 characters
VARCHAR 16383 characters
TEXT 6MB
BLOB 6MB

SQL Statement Limits

Type Upper limit
Maximum number of SQL statements in a single transaction When optimistic transactions and transaction retries are used, the upper limit is 5000.

You can change the limit with the stmt-count-limit configuration item.


Credits Last modified on 2022-04-07 14:42:32: Add TiFlash to the credits.md (#8080)