For MyISAM tables used

OPTIMIZE TABLE t1 

For InnoDB I read that it

 ALTER TABLE t1 ENGINE = InnoDB; 

but an example of extended commands is given in the Maintenance of Partitions section.

What exactly (s) command (s) to use to optimize the table after deleting / modifying a significant amount of InnoDB table data?

  • one
    Well, it seems like dev.mysql.com/doc/refman/5.5/en/...And most likely you don’t need the partitions documentation section at all. Or do you use partitioning? habrahabr.ru/post/66151 - Mike
  • @Mike, no, I do not use. - Plush
  • This works exactly with version 5.0. In InnoDB, before version 5.5, it works like ALTER TABLE ..., from version 5.5 it works like ALTER TABLE ... FORCE. FORCE means that the page just needs to be rebuilt. Prior to version 5.5, FORCE was accepted, but ignored. - AlexOrtizzz

1 answer 1

Reply from comments

The OPTIMIZE TABLE statement is also used for InnoDB.