Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the recommendations for the OPTIMIZE TABLE operation of MySQL

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the suggestions for the OPTIMIZE TABLE operation of MySQL". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the suggestions for MySQL's OPTIMIZE TABLE operation.

1.MySQL officials recommend that defragmentation should not be done frequently (hourly or daily). According to the actual situation, it only needs to be sorted out once a week or once a month, and can be written as a scheduled task.

2.OPTIMIZE TABLE only works on MyISAM,BDB and InnoDB tables, especially on MyISAM tables. In addition, not all tables need to be defragmented, and generally only tables that contain the above variable-length text data types need to be defragmented.

3. While OPTIMIZE TABLE is running, MySQL locks the table.

4. By default, using OPTIMIZE TABLE directly on the data table of the InnoDB engine may display a prompt for "Table does not support optimize, doing recreate + analyze instead". At this time, we can

Restart MySQL with the mysqld-- skip-new or mysqld-- safe-mode command so that other engines can support OPTIMIZE TABLE.

At this point, I believe you have a deeper understanding of "what are the suggestions for the OPTIMIZE TABLE operation of MySQL?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report