Query performance please Help!!!!!! [message #19926] |
Thu, 18 April 2002 08:39 |
aish
Messages: 44 Registered: March 2001
|
Member |
|
|
Hi,
Can anybody tell be How to improve this query this is taking forever
select substr(d.name,1,14) "dist",
sum(r.room_net_sq_foot) "nsf",
sum(r.student_station_count) "sta",
sum(distinct(r.cofte)) "fte"
from b_fish_report r,
g_efis_organization d
where substr(r.organization_code,-2,2) = substr(d.code,-2,2) and
d.organization_type = 'CNTY' and
r.room_satisfactory_flag = 'Y' and
substr(d.code,-2,2) between '01' and '72'
-- rownum < 50
group by d.name, r.organization_code
order by d.name
The unique is defined on organization_type and organization_code
Thnnx
Aish
|
|
|
|
|