ibazz — 2010-01-12T14:02:27-05:00 — #1
I have a query which according to phpMyAdmin, takes 0.2 seconds to complete. seems quite long. However, when I profile it, the output is as below and it doesn't add up to anything like 0.2 secs.
Presumably I am not aware of something that makes the difference. what am I missing please?
Opening tables 0.000040
System lock 0.000004
Table lock 0.000010
Sending data 0.000182
query end 0.000005
freeing items 0.000006
closing tables 0.000004
removing tmp table 0.000010
closing tables 0.000007
logging slow query 0.000004
cleaning up 0.000004
In my head that adds up to 0.000419 secs.
dan_grossman — 2010-01-12T15:07:15-05:00 — #2
Did you flush all caches between the first run and the profiling? You might want to restart the MySQL server wholesale as well. There's query caches, table caches, and the operating system level file caches that can be involved in making subsequent queries faster than the first time they're run.
ibazz — 2010-01-12T18:38:14-05:00 — #3
I'll look into that