MySQL deletes data in several cases and whether to free disk space:
1, DROP table table_name immediately free disk space, whether it is InnoDB and MyISAM;
2. TRUNCATE TABLE table_name immediately frees up disk space, both InnoDB and MyISAM. Truncate table is somewhat similar to the drop table and then creat, except that the CREATE table process is optimized, such as when the table structure file is already there and so on. So the speed should be close to the drop table speed;
3, DELETE from table_name delete the table of all data, for MyISAM will immediately free disk space (should be done special processing, also reasonable), InnoDB will not free disk space;
4, for DELETE from table_name where XXX with the deletion of conditions, whether it is InnoDB or MyISAM will not free disk space;
5. After the delete operation, using OPTIMIZE table table_name will free up disk space immediately. Whether it's InnoDB or MyISAM. So to achieve the purpose of freeing up disk space, delete executes the Optimize table operation later.
6, delete from the table after the disk space is not freed, but the next time you insert data, you can still use this part of the space.
Turn from
MySQL release of disk space after data deletion-ZERO-CSDN blog
http://blog.csdn.net/zero__007/article/details/51404091
MySQL Delete data in several cases and whether to free up disk space "Go"