Oracle 10g version
Hi,
I am having multiple queries written in this way where eveywhere I have to select the DISTInCT values from tables.
SELECT COUNT(DISTINCT(scr.dynamic_handle))
/* INTO l_cnt */
FROM staging_scenario_result scr,
staging_position sp
WHERE scr.scenario_name = :Var1
AND scr.feed_instance_id = sp.feed_instance_id
AND scr.feed_row_id = sp.feed_row_id
AND scr.feed_instance_id = :a_feed_instance_id
AND sp.summary_flag = :a_summary_flag
But I am not able to copy paste the explain plan as I am using PL-SQL developer and here posting is image seems no option.
Anyways the issue is everytime I am executing the SP where there are many these kind of queries, its extremely slow.
So please guide me what would be best way to write the query with DISTINCt which can improve performance.
I gone thru many web pages but could not get any better idea to deal with this.
Thanks,
Aashish