DBAtlas · Database operations atlas

Rebuild a table/indexes

MySQLMaintenance

Command

ALTER TABLE customer ENGINE=InnoDB;

What it does

Rebuilds the table with the same engine; recreates indexes and data pages to remove fragmentation and index bloat.

When to use it

To refresh a table with a null ALTER, or to repair a damaged page layout.

Caution

Large tables require temporary disk equal to the table size. To reduce locking: ALTER TABLE customer ENGINE=InnoDB, ALGORITHM=INPLACE, LOCK=NONE;

Open in DBAtlas →

Related