MYSQL - Long query log not get effected

Hello guys,

I have enabled slowlog in Mysql 5.6 and also set the long_query_time = 10 ( restarted the server ), after few days I come back to examine the log which seem weird that  I still found log that  below this threshold being logged and output in the  slowlog. So will this long_query_time = 10  equal to 10 seconds ?

# User@Host: epf[KIT] @  [*****]  Id: 14003
# Query_time: 0.000000  Lock_time: 0.000000 Rows_sent: 1  Rows_examined: 5
SET timestamp=1524108859;

# Time: 180419 11:34:19
# User@Host: epf[KIT] @  [*********]  Id: 14007
# Query_time: 0.031225  Lock_time: 0.000000 Rows_sent: 3  Rows_examined: 7
SET timestamp=1524108859;
motioneyeAsked:
Who is Participating?
 
theGhost_k8Database ConsultantCommented:
Hi,
Bullets below:
  • long_query_time is in Sec.
  • It is dynamic variable you don't need to restart server.
  • 10 is default so you don't need to even set it. Make sure slow query log is enabled.
  • log_queries_not_using_indexes can also be logged this way (which won't respect the long_query_time threshold).
1
 
motioneyeAuthor Commented:
Hi theGhost_k8
That what I thought too, but still it does captured those query below than 10 seconds, actually I have tried to set it like set @@global variable.long_query_time=60;
 
which no changes occurred when I show variables where  variable_name like '%long%;

so what do you think of why  the query above is still printed in the output file ?
0
 
theGhost_k8Database ConsultantCommented:
If you're worried about "set timestamp", you should read --> https://www.percona.com/blog/2007/06/25/does-slow-query-log-logs-all-slow-queries
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.