Mysql optimization
From wikinotes
Timing Queries
Test adding Index
Rather than a JOIN
or IN/NOT IN
,
substitute values for the primary-key values and time it.
Limit Records
The more records included, the slower the query. If you can limit by a date-range that helps a lot.