Slow query when using OR operater in WHERE clause
893411Jan 25 2012 — edited Jan 26 2012Hello guys,
I have a pretty long query (3000 lines). At the end there is a WHERE clause with the following line:
(ProductNr='1111')
execution time: 10sec
When I add the an expression, that is obviously always false:
(1=2 OR ProductNr='1111')
The execution time is now 3 minutes
Do you have any idea why Oracle can't just ignore the first condition, which is always false, and takes so much longer to execute the query?
FYI: I need that condition for a reporting tool (BusinessObjects) where I added an All-Member to my list of values, which looks like 'All'=@Variable OR columnname=@variable. So the user has the possibility to chose the All-member to see the unfiltered results, or chose a specific value. Just as a backgroud information...
thanks for your help!