Optimize table is important when it comes to optimizing MySQL

Source: Internet
Author: User

The amount of data in a table is 1000W, so when you look at the hard disk space that the table occupies, the data itself is 300M and the index is 200M

This time, delete 500W data, this time the data itself 150M, and the index is still around 200M

When you delete data, MySQL does not reclaim the occupied storage space of the deleted data, as well as the index bits.

Instead of waiting for new data to compensate for the vacancy, there is a lack of it, and if there is no data to fill the vacancy at 1:30, it would be a waste of resources.

So for the comparison of the frequency of the table, to regularly carry out optimize, one months once, see the actual situation and decided.

Optimize table xxxxxx;

OPTIMIZE table works only on MyISAM, BDB, and InnoDB tables.

Note that MySQL locks the table during the Optimize table run.

Optimize table is important when it comes to optimizing MySQL

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.