9

My Wordpress tables appear to be in need of optimization so I looked into the commmand OPTIMIZE TABLE . When I run the command I get the following results:

Table does not support optimize, doing recreate + analyze instead

The tables are built using the Wordpress 2.91 installer and haven't been modified at all.

  1. Is this normal?
  2. How can I optimize my database to keep things working correctly?
1

4 Answers 4

5

Have you found the MySQL documentation? It's extensive and useful.

When you run OPTIMIZE TABLE against InnoDB tables it outputs the Table does not support optimize, doing recreate + analyze instead message.

From the documentation:

OPTIMIZE TABLE is mapped to ALTER TABLE, which rebuilds the table to update index statistics and free unused space in the clustered index.

MySQL 5.1 OPTIMIZE TABLE syntax

3
  • 1
    With this in mind, be certain as to your engine before enabling skip-innodb as I suggested in your earlier post.
    – Warner
    Mar 23, 2010 at 21:26
  • 1
    Funny, I searched many times for support on this topic and didn't find that info... So, actually, the mySQL documentation isn't really that useful.... Even so, I still don't see an answer to my question on how to keep my database working correctly without being able to optimize the database...
    – Dscoduc
    Mar 23, 2010 at 21:47
  • 2
    The message indicates that it is optimizing the table. The reason why it's so verbose is because it's essentially a shortcut for the alter table statement, which is what had to be used instead in earlier versions of MySQL because OPTIMIZE TABLE couldn't be run against InnoDB. Why do you believe you need to optimize the table for your database to operate correctly?
    – Warner
    Mar 24, 2010 at 5:09
5

You can optimize an InnoDB table by doing

ALTER TABLE tablename ENGINE='InnoDB';

This will create a copy of the original table drop the original table and put the new table in it's place.

There is some additional information here which includes things you should be aware of.

Also in the MySQL Documentation. See the comment by Dathan Pattishall on May 25 2004 4:41pm about half way down the page.

Although this should be safe to do you should make and test a backup first.

1
  • 2
    This produces the exact same results as running OPTIMIZE TABLE against an InnoDB table in MySQL.
    – Warner
    Mar 24, 2010 at 5:13
2

it is possible

use a wp database plugin like http://wordpress.org/extend/plugins/wp-dbmanager/

& activate the plugin

& go to the page & click on optimize database it will optimize your database

No need of entering any sql logins. It fetches from wp-config.php

2

OPTIMIZE does work for InnoDB. At least it does now. This is 5.6 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.

Read : Optimize Table

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .