This problem occurs when the delete is followed by the condition.
Delete from table_name WHERE condition
When you delete data, the amount of space that the datasheet occupies does not change.
When you do not follow the conditions directly delete.
The data is cleared, and the space of the datasheet becomes 0.
If a large portion of the table data has been deleted, or there are many changes and variable-length table rows (varchar tables, VARBINARY, blobs, or text columns) have been changed because of the fragments left in the data file after the delete operation. Delete simply deletes the data identifier and does not defragment the data file, and when new data is inserted, the record space that is placed to remove the identity is reused again, and you can use the Optimize table to reclaim unused space and defragment the data file.
OPTIMIZE table works only for MyISAM, BDB, and InnoDB tables.
OPTIMIZE table name;
For the MyISAM engine, using optimize table also has the following features:
If the table has deleted or split rows, repair the table. [Repair Table]
If The index pages are not sorted, sort them. [Index not sorted, sort]
If The table ' s statistics are not up to date (and the repair could is accomplished by sorting the index), update them. [Update it if the table's statistics are not up to date]
After the bulk deletion of the Myiam datasheet, found that the space is not recycled, to reclaim space by optimize table
The above mentioned is a small set of MySQL to introduce the delete record database size unchanged after the relevant knowledge, I hope to help!