This section describes limits for
tables, indexes, tablespaces, and other aspects of the
InnoDB storage engine.
A table can contain a maximum of 1000 columns.
A table can contain a maximum of 64 secondary indexes.
By default, the index key prefix length limit is 767 bytes. See Section 13.1.13, “CREATE INDEX Syntax”. For example, you might hit this limit with a column prefix index of more than 255 characters on a
VARCHARcolumn, assuming a
utf8mb3character set and the maximum of 3 bytes for each character. When the
innodb_large_prefixconfiguration option is enabled, the index key prefix length limit is raised to 3072 bytes for
InnoDBtables that use the
If you specify an index key prefix length that exceeds the limit, the length is silently reduced to the maximum length.
The limits that apply to index key prefixes also apply to full-column index keys.
A maximum of 16 columns is permitted for multicolumn indexes. Exceeding the limit returns an error.
ERROR 1070 (42000): Too many key parts specified; max 16 parts allowed
The maximum row size, excluding any variable-length columns that are stored off-page, is slightly less than half of a page. That is, the maximum row size is about 8000 bytes.
LONGTEXTcolumns must be less than 4GB, and the total row size, including
TEXTcolumns must be less than 4GB.
If a row is less than half a page long, all of it is stored locally within the page. If it exceeds half a page, variable-length columns are chosen for off-page storage until the row fits within half a page, as described in Section 14.15.2, “File Space Management”.
The row size for
BLOBcolumns that are chosen for off-page storage should not exceed 10% of the combined redo log file size. If the row size exceeds 10% of the combined redo log file size,
InnoDBcould overwrite the most recent checkpoint which may result in lost data during crash recovery. (Bug#69477).
InnoDBsupports row sizes larger than 65,535 bytes internally, MySQL itself imposes a row-size limit of 65,535 for the combined size of all columns. See Section 8.4.7, “Limits on Table Column Count and Row Size”.
On some older operating systems, files must be less than 2GB. This is not an
InnoDBlimitation. If you require a large system tablespace, configure it using several smaller data files rather than one large data file, or distribute table data across file-per-table data files.
The combined maximum size for
InnoDBlog files is 4GB.
The minimum tablespace size is slightly larger than 10MB. The maximum tablespace size is 64TB, which is also the maximum size for a table.
Tablespace files cannot exceed 4GB on Windows 32-bit systems (Bug #80149).
The path of a tablespace file, including the file name, cannot exceed the
MAX_PATHlimit on Windows. Prior to Windows 10, the
MAX_PATHlimit is 260 characters. As of Windows 10, version 1607,
MAX_PATHlimitations are removed from common Win32 file and directory functions, but you must enable the new behavior.
For limits associated with concurrent read-write transactions, see Section 14.9.7, “Undo Logs”.