Skip to content

Instantly share code, notes, and snippets.

@ryanthames
Created April 1, 2016 14:37
Show Gist options
  • Save ryanthames/a1f929dccb0c3c2ad0d2137b0284834e to your computer and use it in GitHub Desktop.
Save ryanthames/a1f929dccb0c3c2ad0d2137b0284834e to your computer and use it in GitHub Desktop.
select * from
(
select sql_id, sql_text, executions,
elapsed_time, cpu_time, buffer_gets, disk_reads,
elapsed_time / executions as avg_elapsed_time,
cpu_time / executions as avg_cpu_time,
buffer_gets / executions as avg_buffer_gets,
disk_reads / executions as avg_disk_reads
from v$sqlstats
where executions > 0
order by elapsed_time / executions desc
)
where rownum <= 25;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment