Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: UNION or OR in query
On Thu, 03 May 2007 00:06:25 GMT, "Dereck L. Dietz"
<dietzdl_at_ameritech.net> wrote:
>In the book "Oracle SQL Tuning" by Mark Gurry there is a section on pages
>63-64 about using a UNION instead of an OR. The example given differs from
>some code I've been looking at but I was wondering if the principle still
>applied.
>
>Would the second query below be more efficient like the examples in the book
>above implied?
The answer to this question would be primarily determined by looking
at EXPLAIN PLAN results.
One would assume Oracle is capable of rewriting automagically #1 to
#2.
I would recommend comparing EXPLAIN PLANs if you didn't already do so.
-- Sybrand Bakker Senior Oracle DBAReceived on Thu May 03 2007 - 00:03:48 CDT
![]() |
![]() |