Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Optimization of UNION

Optimization of UNION

From: Michael Keppler <Michael.Keppler_at_bigfoot.com>
Date: Thu, 9 Sep 1999 13:36:56 +0200
Message-ID: <7r85ot$agk@TGZ3>


Hello everybody !

If I have to queries on the same columns of the same tables, will the optimizer make a OR statement from a UNION? (I think, OR will be faster normally, right?)

For example, If I use

select col1
from table1
where col2=xyz
union
select col1
from table2
where col3=abc

will this be optimized to "where col2=xyz or col3=abc" ? And if yes, can the optimizer do this also on queries which do not have all (but some) the same tables in the select statement ? Could I give the optimizer a hint for this ?

Ciao, Michael.

--
Michael Keppler, MCSE
IT logic GbR
Michael.Keppler_at_gmx.de Received on Thu Sep 09 1999 - 06:36:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US