MySQL performance, UNION then JOIN, or JOIN on each part of the UNION?
It depends.  Let's dissect each scenario.

( SELECT UNION ALL SELECT ) JOIN


breaks down into


create tmp table
do first select into that tmp (n1 rows)
do second select into that tmp (n2 rows)
dedup because of ALL -- change to DISTINCT to skip this step (n3=n1+n2, or fewer rows)
join n3 times


And...

( SELECT JOIN ) UNION ALL ( SELECT JOIN )


breaks down into


create tmp table
do first select and join into that tmp (n1 rows &amp; n1 joins)
do second select and join into that tmp (n2 rows &amp; n2 joins)
dedup because of ALL -- change to DISTINCT to skip this step (n3=n1+n2, or fewer rows)


So it depends on which case you have.


If the JOIN filters out some rows, then whatever follows it will have less work.
If you switch to UNION DISTINCT, that will shrink the subsequent work.
If the JOIN adds lots of bulky columns, the join-first case is building a bigger tmp table.


Watch out for &lt;autokey0&gt; -- it means you have a tmp table without an index, but 5.6 was smart enough to create one for you.  Your SELECT, as written, should not need that unless ThingsDetails does not have an index on ThingsId.  If that is the case, then add an index rather than taking advantage of autokey.