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
1 Answer 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.)
-
(And
SHOW WARNINGS;
so you can see the "extended" stuff.)Rick James– Rick James2017年09月13日 15:20:11 +00:00Commented Sep 13, 2017 at 15:20
Explore related questions
See similar questions with these tags.
log_output
.