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 -> Re: Performance on queries with a lot of AND / OR operators

Re: Performance on queries with a lot of AND / OR operators

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 23 Aug 2005 02:26:40 -0700
Message-ID: <1124789200.014935.99380@g49g2000cwa.googlegroups.com>


>>What difference does it make what code optimizer I use when my question was on SQL?

First thing you should do is to learn about Oracle optimizers (you don't seem to know what Sybrand is talking about).

>>select x
>>from y
>>where field1 like 'a'
>> and field2 like 'b'
>> and field3 like 'c'
>>
>>versus
>>
>>select x
>>from y
>>where field1 like 'a'
>> and (field2 like 'b' or field2 like 'c')
>> and (field4 like 'd' or (field5 like 'e' and field6 like 'f'))

Without binding -as Sybrand tried to explain to you ("AND you don't use bind variables, then that would be sufficient to bring any system on its knees. ")- you are dead.

Anyway:

If you "just want to know the impact on a database" of the queries abobe, just take the two sentences and do EXPLAIN PLAN, autotrace, tkprof... and just compare them.

Cheers.

Carlos. Received on Tue Aug 23 2005 - 04:26:40 CDT

Original text of this message

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