Check selects for costs / seconds per cost


select * from (
select a.hash_value, a.cost, b.elapsed_time/1000000/greatest(b.executions,1) elapsed,
decode(b.executions,0,0,b.elapsed_time/b.executions)/1000000/greatest(a.cost,1) sec_per_cost,
b.sql_text
from v$sql_plan a, v$sql b
where a.hash_value=b.hash_value
and a.id=0
) where cost > 0 and elapsed > 0
order by sec_per_cost desc

 

Leave a Reply

Your email address will not be published. Required fields are marked *