Optimize and repair Innodb database

Discussion in 'Databases' started by ASTRAPI, Apr 18, 2011.

  1. #1
    Hello

    I was use Myisam and when i want to repair or optimize it i was run a command from ssh:

    mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

    Now i am using Innodb and i want to ask if i can do the same and how?

    Repair and optimize.

    Thank you
     
    ASTRAPI, Apr 18, 2011 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You don't need to repair using Innodb. You can run optimize on the tables. However, there is a bug in Innodb wherein it takes a long time to optimize tables that are large with large indexes. In these cases it's best to alter the tables by dropping the indexes, then run optimize, and then restoring the table indexes.

    Here's an article regarding the optimize bug: http://www.mysqlperformanceblog.com...t-running-optimize-on-your-innodb-table-stop/

    If your tables are reasonably sized, running optimize should be fine.
     
    jestep, Apr 18, 2011 IP
  3. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you mean the full text indexes?

    If yes i have delete them as i use sphinx on my forum and sphinx don't use them.

    What command i must run to optimize?

    Thank you
     
    ASTRAPI, Apr 18, 2011 IP