QuestionQ161

Performance

You use the InnoDB engine, with the innodb_file_per_table option enabled.

You delete a substantial number of rows from a large table named FACTORY.INVENTORY.

You must now reorganize the physical storage of the table data and its associated index data for the INVENTORY table to reduce storage space and improve I/O efficiency.

Which command accomplishes this?

  • A mysqlcheck -u root -p FACTORY.INVENTORY
  • B ANALYZE TABLE FACTORY.INVENTORY
  • C CHECK TABLE FACTORY.INVENTORY
  • D OPTIMIZE TABLE FACTORY.INVENTORY
  • E mysqldump -u root -p FACTORY INVENTORY
Explanation

OPTIMIZE TABLE reorganizes the physical storage of table data and associated index data to reduce storage use and improve I/O efficiency. After substantial deletes from an InnoDB table that has its own .ibd file because innodb_file_per_table is enabled, it rebuilds the table and indexes and can reclaim disk space.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!