Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Problem with performance of select

Problem with performance of select

From: Søren Kongstad <kongstad_at_kongstad.net>
Date: Mon, 20 Oct 2003 10:57:18 +0200
Message-ID: <bn081f$rsit4$1@ID-177910.news.uni-berlin.de>


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,

Anyfunction3(productid) as a3,
Anyfunction4(productid) as a4
from
products

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,

Anyfunction3(productid) as a3,
Anyfunction4(productid) as a4
from
products
)
where
s1 <> a1
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

Original text of this message

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