MySQL Delete data in several cases and whether to free up disk space "Go"

Source: Internet
Author: User
Tags mysql delete

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"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.