SELECT *
FROM { SELECT * FROM BigMillionTable UNION ALL SELECT * FROM SmallTensTable }
WHERE (some_condition)
Vs
SELECT *
FROM BigMillionTable
WHERE (some_condition)
UNION ALL
SELECT *
FROM SmallTensTable
WHERE (some_condition)
My questions:
- Does the first query need to put all the rows in the
BigMillionTable
in the main memory to performUNION ALL
? - Which query provides better performance ?