Following up on yesterday’s post on the MySQL slow query log, I’ve been doing quite a bit of analysis of our slow query log entries.
To make sure we catch everything, we’ve also turned on log_queries_not_using_indexes. This gives us a couple of problems
- Partly because we’re at an early stage of deployment, some tables are so small that even though the correct indexes are defined, they’re not used.
- Certain tables are updated frequently, with lots of inserts and deletes taking place. Most of the time, the tables in question contain relatively few rows, again causing the optimizer to ignore the defined indexes and the slow query log to be updated.
In other words, we’re having a boatload of false positives — just a quick analysis reveals more than 100k of the 144k queries picked up so far by the slow query log are …
[Read more]