MySQL 5.1 does not support the statements
CHECK TABLE, OPTIMIZE
TABLE, ANALYZE TABLE, or
REPAIR TABLE for partitioned tables. However,
there are alternatives available for performing partitioning
maintenance tasks.
Beginning with MySQL 5.1.5, you can rebuild partitions using
ALTER TABLE ... REBUILD PARTITION, which has
the same effect as dropping all records stored in the partition,
then reinserting them. This can be useful for purposes of
defragmentation. You can rebuild a one or more partitions
belonging to the same table at one time using this statement, as
shown in these examples:
ALTER TABLE t1 REBUILD PARTITION p1; ALTER TABLE t1 REBUILD PARTITION p0, p2;
Executing the first statement rebuilds the partition named
p1 from the table t1.
Performing the second statement rebuilds partitions
p0 and p2 from table
t1.
ALTER TABLE ... REORGANIZE PARTITION also
causes partition files to be rebuilt.
The statements ANALYZE PARTITION,
CHECK PARTITION, OPTIMIZE
PARTITION, and REPAIR PARTITION
were also introduced in MySQL 5.1.5 for the purpose of,
respectively, analyzing, checking, optimizing, and repairing
individual or multiple partitions. Support for these statements
was removed in MySQL 5.1.24. (Bug#20129)
To accomplish these tasks, you can use
mysqlcheck or, with partitioned
MyISAM tables, you can use
myisamchk. See Section 4.5.3, “mysqlcheck — A Table Maintenance and Repair Program”,
and Section 4.6.3, “myisamchk — MyISAM Table-Maintenance Utility”, for more information.

User Comments
Add your own comment.