This question already has an answer here:

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?

marked as duplicate by Michael - sqlbot, Kin Shah, Philᵀᴹ, RolandoMySQLDBA mysql May 27 '14 at 21:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Could it be possible it is caused by network latency? – frlan May 27 '14 at 7:50
  • I doubt it , as the same insert queries are consistently logged in some flows but not in the other. The pattern remains the same. I am not sure whether the lock table time has some thing to do with this. – BP_EV May 27 '14 at 7:55
  • @BP_EV - Let's try a test: Run 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. – Rick James Oct 17 '18 at 23:06
  • And... Which engine? – Rick James Oct 17 '18 at 23:08

Browse other questions tagged or ask your own question.