Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Problem with performance of select
Hi
I have a query looking something like this
select
productid,
Somefunction1(productid) as s1, Somefunction2(productid) as s2, Somefunction3(productid) as s3, Somefunction4(productid) as s4, Anyfunction1(productid) as a1, Anyfunction2(productid) as a2,
Which takes about a minute to retrieve.
Now I want to discard all results where s1=a2, s2=a2,s3=a3,s4=a4 since i have to find only those products with different values in one or more place.
When I try this query
select * from
(
select
productid,
Somefunction1(productid) as s1, Somefunction2(productid) as s2, Somefunction3(productid) as s3, Somefunction4(productid) as s4, Anyfunction1(productid) as a1, Anyfunction2(productid) as a2,
or s2 <> a2 or s3 <> a3 or s4 <> a4
The query time is extended dramatically (It hadn't finished after an hour!)
What can I do differently to get the result?
Sincerely
Søren Kongstad Received on Mon Oct 20 2003 - 03:57:18 CDT