The system will slowly become slow in the application for a long time, whether it is human or machine in order to better work and study need to study properly. Database is the same as the use of long-time, nature will produce space debris, we need all the data blocks in the database for maintenance and collation. The following example illustrates and explains this problem.
The MySQL database provides the appropriate functions for the collation of the data. Optimize table. Data in the database is collated based on the data obtained.
1. To create a test database table
(1) CREATE TABLE TB1 table
(2) The following information is present in the database folder after the table is created
2. Inserting test data
(1) Adding test data
(2) Simulation to delete redundant data
(2) Careful may find that the storage data data space does not carry on the space collection, below through Optimize table table_name; The data space is effectively organized.
Do the above, after the inquiry information to know
Table does not support optimize, doing recreate + analyze instead.
It is because, the table, and the using is InnoDB.
You can optimize the InnoDB tables by using this.
As long as the error caused by the InnoDB operation is used. There is also a command according to the MySQL feature to idui the space as follows
MySQL Optimization 1