Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 43.3Mb
PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.3Kb
Man Pages (Zip) - 402.5Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  / ...  / Partitioning  / Restrictions and Limitations on Partitioning  /  Partitioning Limitations Relating to Storage Engines

26.6.2 Partitioning Limitations Relating to Storage Engines

In MySQL 8.0, partitioning support is not actually provided by the MySQL Server, but rather by a table storage engine's own or native partitioning handler. In MySQL 8.0, only theInnoDB andNDB storage engines provide native partitioning handlers. This means that partitioned tables cannot be created using any other storage engine than these. (You must be using MySQL NDB Cluster with theNDB storage engine to createNDB tables.)

InnoDB storage engine. InnoDB foreign keys and MySQL partitioning are not compatible. PartitionedInnoDB tables cannot have foreign key references, nor can they have columns referenced by foreign keys.InnoDB tables which have or which are referenced by foreign keys cannot be partitioned.

ALTER TABLE ... OPTIMIZE PARTITION does not work correctly with partitioned tables that useInnoDB. UseALTER TABLE ... REBUILD PARTITION andALTER TABLE ... ANALYZE PARTITION, instead, for such tables. For more information, seeSection 15.1.9.1, “ALTER TABLE Partition Operations”.

User-defined partitioning and the NDB storage engine (NDB Cluster).  Partitioning byKEY (includingLINEAR KEY) is the only type of partitioning supported for theNDB storage engine. It is not possible under normal circumstances in NDB Cluster to create an NDB Cluster table using any partitioning type other than [LINEAR]KEY, and attempting to do so fails with an error.

Exception (not for production): It is possible to override this restriction by setting thenew system variable on NDB Cluster SQL nodes toON. If you choose to do this, you should be aware that tables using partitioning types other than[LINEAR] KEY are not supported in production.In such cases, you can create and use tables with partitioning types other thanKEY orLINEAR KEY, but you do this entirely at your own risk. You should also be aware that this functionality is now deprecated and subject to removal without further notice in a future release of NDB Cluster.

The maximum number of partitions that can be defined for anNDB table depends on the number of data nodes and node groups in the cluster, the version of the NDB Cluster software in use, and other factors. SeeNDB and user-defined partitioning, for more information.

The maximum amount of fixed-size data that can be stored per partition in anNDB table is 128 TB. Previously, this was 16 GB.

CREATE TABLE andALTER TABLE statements that would cause a user-partitionedNDB table not to meet either or both of the following two requirements are not permitted, and fail with an error:

  1. The table must have an explicit primary key.

  2. All columns listed in the table's partitioning expression must be part of the primary key.

Exception.  If a user-partitionedNDB table is created using an empty column-list (that is, usingPARTITION BY KEY() orPARTITION BY LINEAR KEY()), then no explicit primary key is required.

Partition selection.  Partition selection is not supported forNDB tables. SeeSection 26.5, “Partition Selection”, for more information.

Upgrading partitioned tables.  When performing an upgrade, tables which are partitioned byKEY must be dumped and reloaded. Partitioned tables using storage engines other thanInnoDB cannot be upgraded from MySQL 5.7 or earlier to MySQL 8.0 or later; you must either drop the partitioning from such tables withALTER TABLE ... REMOVE PARTITIONING or convert them toInnoDB usingALTER TABLE ... ENGINE=INNODB prior to the upgrade.

For information about convertingMyISAM tables toInnoDB, seeSection 17.6.1.5, “Converting Tables from MyISAM to InnoDB”.