MySQL EXPLAIN Analyzer
Paste the output of EXPLAIN ANALYZE or EXPLAIN. dbCove AI finds the step that costs the time, says why and gives the fix as runnable SQL.
How to get the plan in MySQL
Runs the query and measures every step:
EXPLAIN ANALYZE SELECT ...;The plan as a tree, with estimates:
EXPLAIN FORMAT=TREE SELECT ...;The JSON form has the costs:
EXPLAIN FORMAT=JSON SELECT ...;What it looks for in a MySQL plan
DATE(created_at) or a cast in the WHERE clause hides the index. A range on the column itself keeps it.
A scan of a large table where the filter keeps a small fraction of the rows.
The estimate of each step against the rows it really returned.
Sorts and GROUP BY that an index in the right order would remove.
An inner table read once per outer row without a usable index.
This was one statement. dbCove watches all of them.
On your own databases dbCove AI has the history of every plan, every wait and every change, so it can tell you why a plan flipped, not only that it is slow. Free for 2 databases of each engine.
Questions
Is what I paste kept?
It is sent to our AI provider to be explained and kept by us for up to 12 months to improve the tools; the AI provider does not keep it or train on it. Remove passwords and personal data before you paste.
EXPLAIN or EXPLAIN ANALYZE?
EXPLAIN ANALYZE, where the version has it: it runs the query and gives the actual rows and time of each step. Plain EXPLAIN still gets an answer, from the estimates.
Does EXPLAIN ANALYZE run the query?
Yes. It runs the SELECT to measure it, so run it where the query's load is acceptable.
Which versions does it read?
MySQL 5.7 and 8.x, including Amazon RDS for MySQL, Aurora MySQL and Azure Database for MySQL.