If you are joining most of the rows of 2 big tables, union will be faster (using full table scan and sort merge). If a sub-query is executed thousands of time to return more than 30 percent of a table, you would be better of by scanning all the information once (table scan) and merging the info via a union. This might not be true but in many situation, the subquery will use an index, and read the data in one of the table. The problem is that it's the data in the driving table that tells what data to read in the second table. Bottom line, you might end up reading multiple time the same block to read the data of table 2, instead of one once in the case of a table scan.
This might not describe your situation properly. Like carp said, it depends of lots of things. But what I have described might help you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.