Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Query running slow
Hi List,
The below query is taking a very long time to execute. The META_ROUTING table has around 19,95,347 records. How do I make the query run fast?
select /*+ use_hash(meta_routing)*/ meta_routing_key, org_stn_key,
dest_stn_key, priority from meta_routing
where priority in
(select min(priority) from meta_routing group by org_stn_key, dest_stn_key)
and (org_stn_key, dest_stn_key) not in(select org_stn_key, dest_stn_key from
(select dense_rank() over(partition by org_stn_key, dest_stn_key order by
priority nulls last) as ranking,
meta_routing_key, org_stn_key, dest_stn_key, priority
from meta_routing)
where ranking = 2 )
union
select meta_routing_key, org_stn_key, dest_stn_key, priority from
(select dense_rank() over(partition by org_stn_key, dest_stn_key order by
priority nulls last) as ranking,
meta_routing_key, org_stn_key, dest_stn_key, priority
from meta_routing)
where ranking = 2
Any help in this regard is very much appreciated.
Thanks and Regards,
Ranganath
WARNING: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Krishnaswamy, Ranganath INET: Ranganath.Krishnaswamy_at_blr.hpsglobal.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Mon Apr 21 2003 - 07:46:47 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |