0

My website AdminPanel has a PHP file which takes almost 30-40 seconds in loading. I doubt the queries which are making the mess, but may be it is the code but the code structure seems perfect. I want to find and check the all the queries execution and running time i.e how much time it takes to execute? But i can't.

I tried the slow query logs option but it is not logging anything. And from the general log i just see queries but no execution time and details.

Thanks

asked Sep 13, 2017 at 6:37
1

1 Answer 1

1

SET GLOBAL long_query_time = 1; to log slow queries taking 1 second or more.

EXPLAIN EXTENDED SELECT ..... to see valuable information about how the query is getting to the result.

Follow immediately in the same session, SHOW WARNINGS; to see how the Optimizer rearranged the sequence of events.
(Rick James, thanks for the reminder.)

answered Sep 13, 2017 at 11:25
1
  • (And SHOW WARNINGS; so you can see the "extended" stuff.) Commented Sep 13, 2017 at 15:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.