Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query running realy slow 1

Status
Not open for further replies.

blexman

Programmer
Jul 18, 2001
34
CA
Can anybody help me speed up this query ? I have an index on
p.pptyno and pn.pptyno. Is there anyway of recoding the date logic in the where clause ?

select
count(*)
from
pn,
p
where p.pptyno=pn.pptyno and
pn.filedate>=decode(p.saledate,0,p.adjdate,p.saledate)



thanks
 
I think the following is an equivalent expression that avoids function calls. With luck the performance will be better.

select
count(*)
from
pn,
p
where p.pptyno=pn.pptyno and
(p.saledate = 0 and pn.filedate >= p.adjdate
or
p.saledate <> 0 and pn.filedate >= p.saledate)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top