What does “Table does not support optimize, doing recreate + analyze instead” mean?

后端 未结 4 1374
抹茶落季
抹茶落季 2021-01-30 12:32

I am working on MySQL 5.5 and trying to do index rebuild using an OPTIMIZE TABLE query. I am getting the error below:

Table does not support

4条回答
  •  遇见更好的自我
    2021-01-30 12:41

    OPTIMIZE TABLE works fine with InnoDB engine according to the official support article : http://dev.mysql.com/doc/refman/5.5/en/optimize-table.html

    You'll notice that optimize InnoDB tables will rebuild table structure and update index statistics (something like ALTER TABLE).

    Keep in mind that this message could be an informational mention only and the very important information is the status of your query : just OK !

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

提交回复
热议问题