I have an Oralce query like this:
Sub_query1
Union
Sub_query2;
I want to parallelize the query. I searched on web and found some say UNION cannot be parallelized because the sub queries are running in serial and UNION will not run until two sub queries completed. And they are people say UNION can be parallelized. My question is:
(1) can a UNION query be parallezied? if yes, how? if no, why? (2) can I just parallelize the two sub queries?
I am using Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
Thank you!

I think you are confusing running the two queries at the same time versus running the query in parallel. SQL is a descriptive language, which gets translated into code by the SQL engine/optimizer. This query plan consists of many different components, for retrieving data from a table, doing a join, doing aggregations, and so on.
Oracle produces a query plan for your union query. Each component of the query plan can make use of all available processors (assuming the right conditions are met). However, each component basically runs one at a time (to a reasonable approximation). So, the components of the query are parallelized, although the two subqueries don't run at the same time.
One piece of advice. Whenever you think about using a
UNION, you should ask yourself whether or not aUNION ALLwould also work. TheUNION ALLis much more efficient, because it does not have to remove duplicates on the final result set.