优化innodb表 [英] Optimize innodb table

查看:83
本文介绍了优化innodb表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在innodb表上运行优化表时,却收到此消息.这是否意味着该表已经过优化,但是采用了不同的方式?

When i run optimize table on a innodb table, i get this message instead. does it mean that the table has already been optimized, but in a different manner?

表|优化|注意|表不支持优化,而是进行重新创建+分析|"

"table | optimize | note | Table does not support optimize, doing recreate + analyze instead |"

推荐答案

来自文档:

对于InnoDB表,OPTIMIZE TABLE映射到ALTER TABLE,ALTER TABLE重建表以更新索引统计信息并释放聚簇索引中未使用的空间.从MySQL 5.1.27开始,在InnoDB表上运行它时,它会显示在OPTIMIZE TABLE的输出中,如下所示:

For InnoDB tables, OPTIMIZE TABLE is mapped to ALTER TABLE, which rebuilds the table to update index statistics and free unused space in the clustered index. Beginning with MySQL 5.1.27, this is displayed in the output of OPTIMIZE TABLE when you run it on an InnoDB table, as shown here:

mysql> OPTIMIZE TABLE foo;
+----------+----------+----------+-----------------------------------------------------------
| Table    | Op       | Msg_type | Msg_text                                                    
+----------+----------+----------+-----------------------------------------------------------    
| test.foo | optimize | note     | Table does not support optimize, doing recreate + analyze ...
| test.foo | optimize | status   | OK                                                            
+----------+----------+----------+-----------------------------------------------------------

通过使用--skip-new或--safe-mode选项启动mysqld,可以使OPTIMIZE TABLE在其他存储引擎上工作.在这种情况下,OPTIMIZE TABLE仅映射到ALTER TABLE.

You can make OPTIMIZE TABLE work on other storage engines by starting mysqld with the --skip-new or --safe-mode option. In this case, OPTIMIZE TABLE is just mapped to ALTER TABLE.

这篇关于优化innodb表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆