In the past I’ve used the profiling features (e.g. SHOW PROFILES) in MySQL to help with timing SQL statements, especially those in the < 10 millisecond range.
Out of habit I did use this to time all SQL statements however in MySQL 5.5.8 GA I've found this no longer to be representative.
As you can see, the query takes some 50+ms longer with profiling enabled, not to mention they have broken the Source_file column which I've actually used to troll the source code with.
mysql> set profiling=1; 4 rows in set (1.14 sec) 4 rows in set (1.15 sec) 4 rows in set (1.17 sec) mysql> set profiling=0; 4 rows in set (0.37 sec) 4 rows in set (0.37 sec) 4 rows in set (0.37 sec)
Investigating further showed the cause. There appears to be some new overhead that causes profiling to log excessive amount of information.
mysql> show profile source for query 35; …[Read more]