<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="partitioning-limitations-storage-engines">
      </a>
      26.6.2 Partitioning Limitations Relating to Storage Engines
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045082767472">
  </a>
  <p>
   In MySQL 8.4, 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.4, only the
   <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
    <code class="literal">
     InnoDB
    </code>
   </a>
   and
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   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 the
   <code class="literal">
    NDB
   </code>
   storage engine to create
   <code class="literal">
    NDB
   </code>
   tables.)
  </p>
  <p>
   <a name="partitioning-limitations-innodb">
   </a>
   <b>
    InnoDB storage engine.
   </b>
   <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
    <code class="literal">
     InnoDB
    </code>
   </a>
   foreign keys and MySQL
          partitioning are not compatible. Partitioned
   <code class="literal">
    InnoDB
   </code>
   tables cannot have foreign key
          references, nor can they have columns referenced by foreign
          keys.
   <code class="literal">
    InnoDB
   </code>
   tables which have or which are
          referenced by foreign keys cannot be partitioned.
  </p>
  <p>
   <a class="link" href="alter-table-partition-operations.html" title="15.1.9.1 ALTER TABLE Partition Operations">
    <code class="literal">
     ALTER
        TABLE ... OPTIMIZE PARTITION
    </code>
   </a>
   does not work correctly
        with partitioned tables that use
   <code class="literal">
    InnoDB
   </code>
   . Use
   <code class="literal">
    ALTER TABLE ... REBUILD PARTITION
   </code>
   and
   <code class="literal">
    ALTER TABLE ... ANALYZE PARTITION
   </code>
   , instead,
        for such tables. For more information, see
   <a class="xref" href="alter-table-partition-operations.html" title="15.1.9.1 ALTER TABLE Partition Operations">
    Section 15.1.9.1, “ALTER TABLE Partition Operations”
   </a>
   .
  </p>
  <p>
   <a name="partitioning-limitations-ndb">
   </a>
   <b>
    User-defined partitioning and the NDB storage engine (NDB Cluster).
   </b>
   Partitioning by
   <code class="literal">
    KEY
   </code>
   (including
   <code class="literal">
    LINEAR KEY
   </code>
   ) is the only type of
          partitioning supported for the
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   storage engine. It is not
          possible under normal circumstances in NDB Cluster to create
          an NDB Cluster table using any partitioning type other than
          [
   <code class="literal">
    LINEAR
   </code>
   ]
   <code class="literal">
    KEY
   </code>
   , and
          attempting to do so fails with an error.
  </p>
  <p>
   The maximum number of partitions that can be defined for an
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   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. See
   <a class="xref" href="mysql-cluster-nodes-groups.html#mysql-cluster-nodes-groups-user-partitioning" title="NDB and user-defined partitioning">
    NDB and user-defined partitioning
   </a>
   ,
        for more information.
  </p>
  <p>
   The maximum amount of fixed-size data that can be stored per
        partition in an
   <code class="literal">
    NDB
   </code>
   table is 128 TB.
        Previously, this was 16 GB.
  </p>
  <p>
   <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
    <code class="literal">
     CREATE TABLE
    </code>
   </a>
   and
   <a class="link" href="alter-table-partition-operations.html" title="15.1.9.1 ALTER TABLE Partition Operations">
    <code class="literal">
     ALTER
        TABLE
    </code>
   </a>
   statements that would cause a user-partitioned
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   table not to meet either or
        both of the following two requirements are not permitted, and
        fail with an error:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      The table must have an explicit primary key.
     </p>
    </li>
    <li class="listitem">
     <p>
      All columns listed in the table's partitioning
            expression must be part of the primary key.
     </p>
    </li>
   </ol>
  </div>
  <p>
   <b>
    Exception.
   </b>
   If a user-partitioned
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   table
          is created using an empty column-list (that is, using
   <code class="literal">
    PARTITION BY KEY()
   </code>
   or
   <code class="literal">
    PARTITION BY
          LINEAR KEY()
   </code>
   ), then no explicit primary key is
          required.
  </p>
  <p>
   <b>
    Partition selection.
   </b>
   Partition selection is not supported for
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   tables. See
   <a class="xref" href="partitioning-selection.html" title="26.5 Partition Selection">
    Section 26.5, “Partition Selection”
   </a>
   , for more
          information.
  </p>
  <p>
   <b>
    Upgrading partitioned tables.
   </b>
   When performing an upgrade, tables which are partitioned by
   <code class="literal">
    KEY
   </code>
   must be dumped and reloaded.
  </p>
  <p>
   For information about converting
   <code class="literal">
    MyISAM
   </code>
   tables to
   <code class="literal">
    InnoDB
   </code>
   , see
   <a class="xref" href="converting-tables-to-innodb.html" title="17.6.1.5 Converting Tables from MyISAM to InnoDB">
    Section 17.6.1.5, “Converting Tables from MyISAM to InnoDB”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
