December 2003
Beginner
648 pages
14h 1m
English
An optimized table structure is different from a well-designed table. Table structure optimization has to do with reclaiming unused space after deletions and basically cleaning up the table after structural modifications have been made. The OPTIMIZE TABLE SQL command takes care of this, using the following syntax:
OPTIMIZE TABLE table_name[,table_name]
For example, if you want to optimize the grocery_inventory table in the testDB database, use
mysql> optimize table grocery_inventory; +--------------------------+----------+----------+----------+ | Table | Op | Msg_type | Msg_text | +--------------------------+----------+----------+----------+ | testDB.grocery_inventory | optimize | status | OK | +--------------------------+----------+----------+----------+ ...Read now
Unlock full access