Oracle Logical Operator order of execution

From: Wally <wallyraju_at_gmail.com>
Date: Tue, 1 Apr 2008 12:05:35 -0700 (PDT)
Message-ID: <059e0b80-5cde-4f8a-a665-7f3e3765b07a@s50g2000hsb.googlegroups.com>


Oracle 10g R2
Win 2003

I have a select statement which is similar to

select * from test
where
a = v_number
or
b between v_date_low and v_date_high;

In my database , I know for a fact that only one of these conditions will be true at any given time

Can someone tell me if Oracle calculates the left side of the OR operator first or the right side because I don't want Oracle to waste processor cycles calculating one condition when the other is already true. I can change the query to the one below if need be

select * from test
where
b < v_date
or
a = v_num;

Thanks in advance. Received on Tue Apr 01 2008 - 14:05:35 CDT

Original text of this message