The mechanism used for DDL operations on
partitioned tables is somewhat different from the online DDL discussed throughout this section. The partitioning
clauses of the
ALTER TABLE statement are only allowed in conjunction with
LOCK=DEFAULT. Although these
operations do not go through the same internal online DDL API as for non-partitioned tables, MySQL still
attempts to minimize data copying and locking where possible:
ADD PARTITION and
PARTITION for tables partitioned by
do not copy any existing data.
TRUNCATE PARTITION does not copy any existing data, for
all types of partitioned tables.
Concurrent queries are allowed during
COALESCE PARTITION for tables partitioned by
LIST. MySQL copies the data while
holding a shared lock.
ADD PARTITION or
PARTITION for a table partitioned by
LINEAR HASH or
LIST, concurrent queries are allowed. Data from the affected partitions is
copied while holding a shared lock.