Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the MySQL equivalent of PostgreSQL's EXPLAIN ANALYZE

I'd like to get a detailed query plan in MySQL similar to EXPLAIN ANALYZE shows in PostgreSQL. Is there an equivalent?

like image 926
foolish Avatar asked Jul 25 '11 06:07

foolish


People also ask

What is analyze in MySQL?

EXPLAIN ANALYZE is a profiling tool for your queries that will show you where MySQL spends time on your query and why. It will plan the query, instrument it and execute it while counting rows and measuring time spent at various points in the execution plan.

What is explain analyze in Postgres?

The ANALYZE option causes the statement to be actually executed, not only planned. Then actual run time statistics are added to the display, including the total elapsed time expended within each plan node (in milliseconds) and the total number of rows it actually returned.

How do I run an explain plan in MySQL?

To view a visual explain execution plan, execute your query from the SQL editor and then select Execution Plan within the query results tab. The execution plan defaults to Visual Explain , but it also includes a Tabular Explain view that is similar to what you see when executing EXPLAIN in the MySQL client.


1 Answers

EDIT: While not a direct equivalent or as detailed as Explain Analyze here are some tools that you can look at

mysql offers EXPLAIN and procedure analyse()
https://dev.mysql.com/doc/refman/8.0/en/explain.html
http://dev.mysql.com/doc/refman/5.0/en/procedure-analyse.html

like image 154
plague Avatar answered Oct 12 '22 18:10

plague