Ready for another post in the EXPLAIN FORMAT=JSON is Cool series! Great! This post will discuss how to see all the information that is contained in optimized queries with
UNION
using the
union_result
and
query_specifications
commands.
When optimizing complicated queries with
UNION
, it is easy to get lost in the regular
EXPLAIN
output trying to identify which part of the output belongs to each part of the
UNION
.
Let’s consider the following example:
mysql> explain -> select emp_no, last_name, 'low_salary' from employees -> where emp_no in (select emp_no from salaries -> where salary < …[Read more]