Syntax structure:[no_write_to_binlog | LOCAL] TABLE[, Tbl_name] ...Optimize table reorganizes the physical storage of tables data and indexes, reducing the IO efficiency when using storage space and improving access to tables. Optimize table
the use of MySQL data files is only extended and not recycled. After you perform a delete on a table, the data files on the disk do not shrink. the usual practice is to logically export and then truncate the original table (or delete the Rebuild)
After a large amount of data is deleted from your database, you may find that the size of the data file is not reduced. This is because fragments are left in the data file after the delete operation. Discuz! The data table optimization function is
After a large amount of data is deleted from your database, you may find that the size of the data file is not reduced. This is because fragments are left in the data file after the delete operation. Discuz! The data table optimization function is
After a large amount of data is deleted from your database, you may find that the size of the data file is not reduced. This is because fragments are left in the data file after the delete operation. Discuz! The data table optimization function is
OPTIMIZE TABLE is used to reclaim unused database space.
When rows of data on a table are deleted, the disk space occupied is not immediately reclaimed, the space is reclaimed after the Optimize table command is used, and the rows of data on the
After you delete a large amount of data in your library, you may find that the data file size does not decrease. This is caused by the fragmentation of the data file after the delete operation. discuz! In the system Number setting interface provides
OPTIMIZE [LOCAL | NO_WRITE_TO_BINLOG] TABLEtbl_name[,tbl_name] ...
If you have deleted a majority of the tables, or if you have made many changes to the tables that contain variable-length rows (tables that contain varchar, blob, or text columns,
CopyCodeThe Code is as follows: repair table 'table _ name' to repair the table
Optimize table 'table _ name' optimize table
Repair table is used to repair damaged tables.Optimize table is used to recycle idle database space. When the data rows in
Copy codeThe Code is as follows:Repair table 'table _ name' REPAIR tableOptimize table 'table _ name' OPTIMIZE tableRepair table is used to REPAIR damaged tables.Optimize table is used to recycle idle database space. When the data rows in the TABLE
REPAIRTABLE and OPTIMIZETABLE optimize TABLE and REPAIR table repair table 'Table _ name' REPAIR table
Optimize table 'Table _ name' OPTIMIZE table
Repair table is used to REPAIR damaged tables.
Optimize table is used to reclaim idle database
Take a look at the description of OPTIMIZE in the manual:OPTIMIZE [LOCAL | No_write_to_binlog] TABLE tbl_name [, Tbl_name] ...If you have deleted a large part of the table, or if you have made many changes to a table with variable-length rows (a
Sometimes, when using MySQL, you may find that even though a table deletes a lot of data, the data and index files of this table are surprisingly small. This is because when MySQL deletes data (especially text and blobs), it leaves a lot of data
description of the OPTIMIZE in the manual:OPTIMIZE [LOCAL | No_write_to_binlog] TABLE tbl_name [, Tbl_name] ...If you have deleted a large part of the table, or if you have made many changes to a table with variable-length rows (a table with a
MySQL official recommendations for table defragmentation optimize table operations1.MySQL The official recommendation is not to often (hourly or daily) defragmentation, generally according to the actual situation, only a weekly or monthly collation
Copy Code code as follows:
REPAIR table ' table_name ' repair form
OPTIMIZE table ' table_name ' optimization tables
The REPAIR table is used to repair damaged tables.
The OPTIMIZE table is used to reclaim unused database space, and when
Today, after the bulk deletion of the Myiam datasheet, found that there is no recycling, after checking the data, found to be through the optimize table to reclaim spaceTest the following to establish a data table:
The code is as
Operating environment: Ubuntu 14.10 MySQL 5.6.25
For tables that contain BLOBs or text fields, if you frequently modify or delete classes, you will need to perform regular optimize table commands to defragment them.
1.create table T1 (id varchar (),
With the long-term use of MySQL, there will certainly be some problems, in general, the MySQL table can not be accessed, it is possible to repair the table, optimized to reduce disk space, convenient backup. Table table_name // table table_name /
Sometimes, when using MySQL, you may find that even though a table deletes a lot of data, the data and index files of this table are surprisingly small. This is because when MySQL deletes data (especially text and blobs), it leaves a lot of data
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.