help in tuning query [message #344219] |
Fri, 29 August 2008 02:09 |
trupti111
Messages: 29 Registered: August 2008 Location: navi mumbai
|
Junior Member |
|
|
Please help in tunng following two queries
table scan is full in both the queries
SELECT sr_no, agent_code, agent_name , report_to,
count(1) over() tc,
row_number() over(order by sr_no) rn
FROM AMS_LTS_LEAD_SUMMARY;
SELECT agent_id, first_name || ' ' || surname agent_name,
AMS_AGENT_MASTER.branch_code, branch_desc, designation,
reporting_to
FROM AMS_AGENT_MASTER, AMS_BRANCH_MASTER
WHERE AMS_AGENT_MASTER.branch_code = AMS_BRANCH_MASTER.branch_code
AND active IN ('A')
AND reporting_to IS NOT NULL
START WITH agent_id IN (SELECT agent_id
FROM AMS_AGENT_MASTER
WHERE reporting_to IS NULL)
CONNECT BY PRIOR agent_id = reporting_to;
|
|
|
|