Misframe

Dec 26, 2017

MySQL Explain Analyzer update (new design and permalinks!)

tl;dr: Try it out here: https://preetam.github.io/explain-analyzer/#!/explain/


I introduced my explain analyzer for MySQL a little over a month ago. Here’s what I wrote at the end of that post:

It could look a lot better. The real thing isn’t as nice as the design, and the design is still pretty bad. I’ll work on that soon. In terms of the implementation, the explain analyzer is a single page app without any state, so if you refresh the page, you’ll lose everything. I think I’m going to add a “share” feature so that you can get a permalink with all of the values saved. That’ll take some more work but I think it would be a neat opportunity to use AWS Lambda for a user-facing site!

Both the design and the sharing feature have been addressed with this month’s update! Here’s what the new design looks like:

Click here to see that explain yourself! That explain output is from this Percona post.

Here is another explain from another Percona post.

You’ll notice that the comments for that are really repetitive. That’s going to be addressed in the next update.

  • Table “salaries”: Matching rows are being accessed. MySQL is using the PRIMARY KEY. MySQL is using the ‘PRIMARY’ index.
  • Table “dept_manager”: Matching rows are being accessed. MySQL is using the PRIMARY KEY. MySQL is using the ‘PRIMARY’ index.
  • Table “employees”: At most one row is accessed from this table using an index. MySQL is using the PRIMARY KEY. MySQL is using the ‘PRIMARY’ index.

If you encounter any problems let me know on GitHub (with a permalink because now you can!). I’m always looking for more interesting explain plans.

Next read these: