I was reading about refactoring a large slow SQL Query over here, and the current highest response is from Mitch Wheat, who wants to make sure the query uses indexes for the
It's usually a good idea to set up a cronjob to optimize indexes and check for errors.
See mysqlcheck. A typical cron job looks something like mysqlcheck -Aaos , which checks all tables in all databases for errors, optimizes indexes, and only outputs on error.