TiDB Limitations

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.

Limitations on identifier length

Identifier typeMaximum length (number of characters allowed)
Database64
Table64
Column64
Index64
View64
Sequence64

Limitations on the total number of databases, tables, views, and connections

Identifier typeMaximum number
Databasesunlimited
Tablesunlimited
Viewsunlimited
Connectionsunlimited

Limitations on a single database

TypeUpper limit
Tablesunlimited

Limitations on a single table

TypeUpper limit (default value)
ColumnsDefaults to 1017 and can be adjusted up to 4096
IndexesDefaults to 64 and can be adjusted up to 512
Rowsunlimited
Sizeunlimited
Partitions8192

Limitation on a single row

TypeUpper limit
Size6 MB by default. You can adjust the size limit via the txn-entry-size-limit configuration item.

Limitations on string types

TypeUpper limit
CHAR256 characters
BINARY256 characters
VARBINARY65535 characters
VARCHAR16383 characters
TEXT6 MB
BLOB6 MB

Limitations on SQL statements

TypeUpper limit
The maximum number of SQL statements in a single transactionWhen the optimistic transaction is used and the transaction retry is enabled, the default upper limit is 5000, which can be modified using stmt-count-limit.