运行 mysqltuner 后,我收到以下输出:
Total fragmented tables: 284
为了进行碎片整理,我尝试了这些:
1. ALTER TABLE tbl_name ENGINE=INNODB
2. Another way to perform a defragmentation operation is to use mysqldump to dump the table to a text file, drop the table, and reload it from the dump file.
这两种方法在 MySQL documentation 中都有描述。 .
但是这些方法都没有帮助。 Mysqltuner 仍然说表是碎片化的。
注意 innodb_file_per_table
在我的配置中是关闭的。
如何对 InnoDB 表进行碎片整理?
最佳答案
ALTER TABLE tbl_name ENGINE=INNODB
是对 innodb 表进行碎片整理的唯一方法。
ALGORITHM=INPLACE 可以帮助我们在线完成。
关于MySQL 对 InnoDB 表进行碎片整理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26514073/