When I heard that MySQL 5.6 was implementing EXPLAIN for writes
(INSERT,UPDATE,DELETE,REPLACE), I was pretty excited. Then I
heard that MySQL 5.6 also was implementing a JSON format for
EXPLAIN and my thought was “I do not care about that!”
Boy, was I wrong. The JSON format does not just put the output
into JSON format, it also gives extra information that’s actually
pretty useful! It can tell you when you are doing an implicit
cast, which parts of a composite index are being used, and when
index condition pushdown are being used. None of these are shown
in regular EXPLAIN (which seems odd, why could they extend the
JSON format but not put the information into the regular EXPLAIN
format?), so using the JSON format is actually a good idea even
if you do not care about what format your output is in.
As a note, MySQL Workbench’s Visual Explain (go to
Query->Visual Explain Current Statement) also gives this
information.
…
[Read more]