When MySQL 5.7 DMR3 was released, I couldn’t wait to try out the new
UNION ALL optimization that no longer requires data to be materialized in a temporary table.
This new optimization can be seen via
EXPLAIN, but it is also nice to run it through
SHOW PROFILES, which breaks down query execution step by step. However, this feature is now deprecated (since it overlaps with
performance_schema), and will be removed in a future version.
So today I wanted to show you a combination of:
- What a
UNION ALLstatement looks like in MySQL 5.6 (
- How it is improved in MySQL 5.7 (
- How you can easily emulate the
SHOW PROFILESfeature with