zoukankan      html  css  js  c++  java
  • Table does not support optimize, doing recreate + analyze instead

    Table does not support optimize, doing recreate + analyze instead

    优化InnoDb 表提示错误!

    ------------------------------------------------

    That's really an informational message.

    Likely, you're doing OPTIMIZE on an InnoDB table (table using the InnoDB storage engine, rather than the MyISAM storage engine).

    InnoDB doesn't support the OPTIMIZE the way MyISAM does. It does something different. It creates an empty table, and copies all of the rows from the existing table into it, and essentially deletes the old table and renames the new table, and then runs an ANALYZE to gather statistics. That's the closest that InnoDB can get to doing an OPTIMIZE.

    The message you are getting is basically MySQL server repeating what the InnoDB storage engine told MySQL server:

    Table does not support optimize is the InnoDB storage engine saying...

    "I (the InnoDB storage engine) don't do an OPTIMIZE operation like my friend (the MyISAM storage engine) does."

    "doing recreate + analyze instead" is the InnoDB storage engine saying...

    "I have decided to perform a different set of operations which will achieve an equivalent result."

    --------------------------------

    因为这种optimize 是支持Myisam 表不支持InnoDb,需要新建一张表把数据复制进去。

     
     

    Best option is create new table with same properties

    CREATE TABLE <NEW.NAME.TABLE> LIKE <TABLE.CRASHED>;
    INSERT INTO <NEW.NAME.TABLE> SELECT * FROM <TABLE.CRASHED>;

    Rename NEW.NAME.TABLE and TABLE.CRASH

    RENAME TABLE <TABLE.CRASHED> TO <TABLE.CRASHED.BACKUP>;
    RENAME TABLE <NEW.NAME.TABLE> TO <TABLE.CRASHED>;

    After work well, delete

    DROP TABLE <TABLE.CRASHED.BACKUP>;

    文章来源:刘俊涛的博客欢迎关注公众号、留言、评论,一起学习。

    __________________________________________________________________________________

    若有帮助到您,欢迎捐赠支持,您的支持是对我坚持最好的肯定(*^_^*)

    耶和华是我的牧者,我必不至缺乏。
  • 相关阅读:
    左偏树——可以标记合并的堆
    主席树——多棵线段树的集合
    [中山市选2011]完全平方数 ——莫比乌斯函数
    决策单调性优化dp
    [NOI2015]寿司晚宴——状压dp
    【[国家集训队]等差子序列】
    线性基——数集压缩自动机
    Java实现 蓝桥杯VIP 算法训练 筛选号码
    BSGS&EXBSGS 大手拉小手,大步小步走
    CRT&EXCRT 中国剩余定理及其扩展
  • 原文地址:https://www.cnblogs.com/lovebing/p/13555838.html
Copyright © 2011-2022 走看看