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;
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

theGhost_k8Database ConsultantCommented:
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).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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 ?
theGhost_k8Database ConsultantCommented:
If you're worried about "set timestamp", you should read -->
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.