Slow running MySQL table? Reindex it

You’ve noticed that a table is not returning data as efficiently as it should be. Then try this

ALTER TABLE <table_name> ENGINE = InnoDB; 

This method uses the ALTER command to change the table engine to InnoDB, even if the table is already using InnoDB. While we have tested with InnoDB, it can also be applied to other storage engines.

Depending on how large this table is and whether it is on a Production site, it might / is best to first stop the site or to take it into Maintenance mode. We recently did this and it took 4 minutes to reindex a Moodle table with 8 million rows.

Afterward the process to load the page increase from 4.4 secs to first byte to 493 ms

Which is a massive justification to do the above.

Check out what we can do for you at CoSector

Leave a comment