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 (default value)
SizeDefaults to 6 MiB and can be adjusted to 120 MiB

You can adjust the size limit via the txn-entry-size-limit configuration item.

Limitations on data types

TypeUpper limit
CHAR256 characters
BINARY256 characters
VARBINARY65535 characters
VARCHAR16383 characters
TEXTDefaults to 6 MiB and can be adjusted to 120 MiB
BLOBDefaults to 6 MiB and can be adjusted to 120 MiB

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 upper limit is 5000.

You can modify the limit via the stmt-count-limit configuration item.

Was this page helpful?