In oracle sql plus, while doing performance testing, I would do
set autotrace traceonly:
which would display the query plan and statistics without printing the actual results. Is there anything equivalent in mysql?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, there’s no equivalent available in MySQL, at least not in the community edition.
MySQL does not implement the kind of “instrumentation” that Oracle has in its code; so there’s no equivalent to an event 10046 trace.
You can preface your SELECT statement with the
EXPLAINkeyword, and that will produce output with information about the execution plan that MySQL would use to run the statement, but that’s just an estimate, and not a monitoring of the actual execution.You can also enable the slow query log on the server, to capture SQL statements that take longer than
long_query_timeseconds to execute, but that really only identifies the long running queries. That would give you the SQL text, along with elapsed time and a count of rows examined.