【发布时间】:2014-10-22 18:02:38
【问题描述】:
运行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 表进行碎片整理?
【问题讨论】:
-
在您的任何桌子上运行
OPTIMIZE TABLE是否有帮助? -
它返回“表不支持优化,而是重新创建+分析”
-
我认为 Mysqltuner 骗了你。
ALTER TABLE tbl_name ENGINE=INNODB重建表,不能分片。您可以使用 Jeremy 的工具来探索 InnoDB 表空间并检查 fragmentatopn 级别blog.jcole.us/2013/01/03/a-quick-introduction-to-innodb-ruby -
我用deciusac.com/linux-2/…这里的查询来查看优化后是否仍然碎片化,我的表格仍然是碎片化的
标签: mysql query-optimization innodb mysqltuner