濮阳杆衣贸易有限公司

主頁 > 知識庫 > optimize table出錯解決方法

optimize table出錯解決方法

熱門標(biāo)簽:灰谷地圖標(biāo)注 省份地圖標(biāo)注 陽江智能電銷機器人 南寧銷售電銷機器人廠家 辦理400電話怎么劃傷 科研地圖標(biāo)注 平頂山手機自動外呼系統(tǒng)違法嗎 江蘇客服外呼系統(tǒng)怎么樣 地圖標(biāo)注軌跡
一個某某庫大概360W,為了提高查詢效率,做點優(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.

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

還有一種方式:

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功能

標(biāo)簽:玉樹 儋州 玉溪 通化 瀘州 蕪湖 泰安 臨汾

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《optimize table出錯解決方法》,本文關(guān)鍵詞  optimize,table,出錯,解決,方法,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《optimize table出錯解決方法》相關(guān)的同類信息!
  • 本頁收集關(guān)于optimize table出錯解決方法的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    禹州市| 延川县| 安西县| 东平县| 新乡市| 沈丘县| 大邑县| 恩平市| 周宁县| 嘉定区| 武强县| 罗江县| 大名县| 文登市| 平利县| 达拉特旗| 定安县| 土默特左旗| 霸州市| 北宁市| 内江市| 喜德县| 广昌县| 济源市| 金阳县| 册亨县| 蓬安县| 屏南县| 逊克县| 荥阳市| 双城市| 乌什县| 中方县| 托克托县| 阜康市| 金沙县| 乌审旗| 佛冈县| 福贡县| 天镇县| 龙岩市|