Optimizing MySQL Queries is often wrongly viewed by many DBAs as a ‘dark art’. For years we have been pre-pending EXPLAIN to SELECT statements in hopes of looking into the entrails of our offered code in hopes that the query optimizer deities looked whit favor on our efforts. But with MySQL 5.6 and the latest versions of MySQL Workbench, we have now entered into the age of an EXPLAIN that works with more than just SELECT statements and the ability to see graphically what is happening to our queries in the optimizer. Take a look at the two screen captures in this post and compare them. The query used is a very simple two table join from the good ol’ World database.
I will dig into some other examples next post on what poor queries look like with VISUAL EXPLAIN as well as some well written queries. This is one graphic tool that an old command line dinosaur like me can enjoy!