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

    show create table history;
    --------------------------
    CREATE TABLE `foo` (
      `itemid` bigint(20) unsigned NOT NULL,
      `clock` int(11) NOT NULL DEFAULT '0',
      `value` double(16,4) NOT NULL DEFAULT '0.0000',
      `ns` int(11) NOT NULL DEFAULT '0',
      KEY `history_1` (`itemid`,`clock`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8

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



    这里mysql给的提示是
    Note>> Table does not support optimize, doing recreate + analyze instead 
    Status>> OK
    也就是说 optimize table 对于innodb来说,无法作为
    a single operation,实际的操作是:
    ALTER TABLE test.foo ENGINE=InnoDB;
    ANALYZE TABLE test.foo;
    

       MySQL5.7已经推荐对于InnoDB的table使用 alter table table_name engine=innodb;语句的方式来进行表碎片优化。

      底层实现的不同,参考:https://dev.mysql.com/doc/refman/5.7/en/optimize-table.html



  • 相关阅读:
    ZOJ Problem Set
    数学之美:生活中的技术
    java泛型【收藏】
    "i=i++"在java等高级语言的解释
    poj1001
    ⑧javaWeb之在例子中学习(过滤器Filter)
    ZOJ Problem Set
    IT十年经典书籍
    ⑦JSP2.0的福利(标签文件)
    myeclipse-common 找不到
  • 原文地址:https://www.cnblogs.com/DataArt/p/9989360.html
Copyright © 2011-2022 走看看