Optimize innodb table

后端 未结 1 1889
天涯浪人
天涯浪人 2021-01-01 19:28

When i run optimize table on a innodb table, i get this message instead. does it mean that the table has already been optimized, but in a different manner?

\"table |

相关标签:
1条回答
  • 2021-01-01 20:15

    From the documentation:

    For InnoDB tables, OPTIMIZE TABLE is mapped to ALTER TABLE, which rebuilds the table to update index statistics and free unused space in the clustered index. Beginning with MySQL 5.1.27, this is displayed in the output of OPTIMIZE TABLE when you run it on an InnoDB table, as shown here:

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

    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 to ALTER TABLE.

    0 讨论(0)
提交回复
热议问题