Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Performance on queries with a lot of AND / OR operators
>>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
![]() |
![]() |