Do MySQL can do automatic EXPLAIN on every query? We only have two Junior DBAs, no Senior DBAs, no one to guide us. We need to review each and every query for almost 30 large projects.  Each query took between 5 minutes and two hours depending on the query. As a reviewer, it was a real drag on my time.
My question is, do MySQL can do automatic EXPLAIN on each query, without having to run EXPLAIN by hand and log the result of un-optimized queries? Or maybe by cronjob? If possible, how to do this?
Enable MySQL's Slow Query log.
Anything that takes more than the defined time will get written into that log and you can take a look at it.
Or, better still, throw it back at the Developer that wrote the query and get them to take a look at it and then then write a better query.
&quot;Teach a man to fish ...&quot; and all that ...
Databases are everybody's responsibility, not just the DBA's.