Mysqls clear fragmentation _ MySQL

Source: Internet
Author: User
Mysqls clear fragmentation operation bitsCN.com

Mysqls fragment operation

Note:

Every time MySQL deletes a row of content from your list, this section is left empty. A large number of delete operations within a period of time will make this blank space more space than the storage list content. When MySQL scans data, the object it scans is actually the capacity limit of the list, that is, the part of the area where data is written in the peak position. If you perform a new insert operation, MySQL will try to use these blank areas, but it still cannot be completely occupied.

Mysql> select table_schema, table_name, data_free, engine from information_schema.tables where table_schema not in ('information _ scheme', 'mysql') and data_free> 0;

+ -------------- + ----------------------- + ----------- + -------- +

| Table_schema | table_name | data_free | engine |

+ -------------- + ----------------------- + ----------- + -------- +

| BK | comments | 9437184 | InnoDB |

| BK | historypwd | 9437184 | InnoDB |

| Ss | app_admin_log | 434 | MyISAM |

| Ss | app_article | 4434 | MyISAM |

| Ss | app_article_category | 43420 | MyISAM |

| Ss | app_config | 3324 | MyISAM |

| Ss | app_converter key | 1132 | MyISAM |

Data_free is The Shard space.

Clear fragments:

Optimize table ss. app_article; this method only supports the MyIsam engine

INNODB usage

Alter table table. name ENGINE = 'innodb'; backup is recommended before use

BitsCN.com

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.