国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > CentOS > 正文

optimize table出錯解決方法

2020-06-21 13:11:41
字體:
來源:轉載
供稿:網友
一個某某庫大概360W,為了提高查詢效率,做點優化,使用optimize table table.name;出現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.

復制代碼
代碼如下:

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.

原來如此,大致意思是說innodb的數據庫不支持optimize,可以用
ALTER TABLE table.name ENGINE='InnoDB';
該方法會對舊表以復制的方式新建一個新表,然后刪除舊表。雖然這個過程是安全的,但是在進行操作時還是先進行備份為好

還有一種方式:

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.

上面是說要求我們在啟動的時候指定--skip-new或者--safe-mode選項來支持optimize功能
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沙雅县| 镇宁| 衡阳县| 林口县| 汪清县| 德化县| 潢川县| 海原县| 廉江市| 工布江达县| 车致| 汉寿县| 和平县| 唐山市| 车险| 祁东县| 阿克陶县| 天祝| 林州市| 塔城市| 安福县| 银川市| 砀山县| 华容县| 正定县| 岳阳市| 新乡市| 九江县| 洞口县| 荥阳市| 浦东新区| 蒙阴县| 安泽县| 岗巴县| 婺源县| 吴堡县| 泽普县| 宝兴县| 夹江县| 仁化县| 新建县|