I am trying to analyze the hibernate query performance in our application. I tried logging all hibernate queries which take more than 100ms execution time from application side as well as using mysql slow query log. I set the long_query_time = 0.10
in my.cnf
.
Now my problem is some of the insert queries which are consistently taking more than 100ms from the application log are getting logged only few times in mysql sloq query log. Also some insert and select statements are not getting logged at all; but when I try running all these statements from SQLYog, they are taking more than 100ms.
Why mysql sloq query log is not logging these statements?
SELECT SLEEP(1);
and see what the timing is in the slowlog versus SQLYog. (Do it a few times to make sure there is not too much variance.) I would expect both to be slightly bigger than 1.000s; the amount bigger may be instructive.