欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

optimize table出錯(cuò)解決方法

  發(fā)布時(shí)間:2012-12-16 12:04:46   作者:佚名   我要評(píng)論
一個(gè)某某庫(kù)大概360W,為了提高查詢效率,做點(diǎn)優(yōu)化,使用optimize table table.name;出現(xiàn)Table does not support optimize, doing recreate + analyze instead
一個(gè)某某庫(kù)大概360W,為了提高查詢效率,做點(diǎn)優(yōu)化,使用optimize table table.name;出現(xiàn)Table does not support optimize, doing recreate + analyze instead
果斷谷歌,查到一段E文。。。

Everytime you do optimize MySQL, by using mysqlcheck -A -o or using ./mysql_optimize from here.
You may see the output

Table does not support optimize, doing recreate + analyze instead.

It is because the table that you are using is InnoDB.

You can optimize the InnoDB tables by using this.

復(fù)制代碼
代碼如下:

ALTER TABLE table.name ENGINE='InnoDB';

This will create a copy of the original table, and drop the original table, and replace to the original place.

Although this is safe, but I suggest you do backup and test first before doing this.

原來(lái)如此,大致意思是說(shuō)innodb的數(shù)據(jù)庫(kù)不支持optimize,可以用
ALTER TABLE table.name ENGINE='InnoDB';
該方法會(huì)對(duì)舊表以復(fù)制的方式新建一個(gè)新表,然后刪除舊表。雖然這個(gè)過(guò)程是安全的,但是在進(jìn)行操作時(shí)還是先進(jìn)行備份為好

還有一種方式:

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 toALTER TABLE.

上面是說(shuō)要求我們?cè)趩?dòng)的時(shí)候指定--skip-new或者--safe-mode選項(xiàng)來(lái)支持optimize功能

相關(guān)文章

最新評(píng)論