My mysql server has long_query_time = 2 configured but I still see these queries reported in slow query log that seem fast:
# Time: 120730 5:06:41
# User@Host: <user> @ <Host> [<IP>]
# Query_time: 0.000412 Lock_time: 0.000060 Rows_sent: 5 Rows_examined: 5
SET timestamp=1343639201;
SELECT album_id FROM `TB_albums` where album_id!='res_4fe4333271bda7.42833845' and deleted is NULL order by `created_time` desc limit 5;
As you can see Query_time: 0.000412 Lock_time: 0.000060 seems way below 2 seconds
Do you have any Idea why these “fast” queries are reported?
MySQL also logs queries which do not use an index
The option
log-queries-not-using-indexesin my.cnf is used to control this. Mine is turned off (by commenting out) as you can see from this snippet of my.cnfIf you don’t have access to the my.cnf, you can check using SQL
Hope that helps!
Chris