It’s important to keep your MySQL tables repaired and optimized, simply add the below command to crontab.
@daily mysqlcheck --all-databases -B -e --auto-repair --optimize
You will need to provide your MySQL root details in .my.cnf
[client] user="root" pass="password"
Alex actually showed me this a while ago but its a good bit of information.