• t.franz - Tuesday, June 12, 2018 7:42 AM

    it depends :-), but both queries could return different results when are used with real tables.

    Your  first query (with UNION ALL) could return duplicates, when you have the same ids in the first and second subquery (e.g. when you add a (2) into the value list after the (5)). The second query (with UNION) would eliminate this duplicates too.

    So it is not valid to compare the performance, since you are comparing different (but similar) things.

    DUH, You are so correct.  and now I see it. I should have thought that through a little better before posting.  Time for more coffee.. 🙂