## Examples of SQL used to identify "poorly performing" SQL statements.

SELECT executions, disk_reads, buffer_gets, 
       round((buffer_gets - disk_reads)
            / buffer_gets, 2) hit_ratio,
       sql_text
FROM   v$sqlarea
WHERE  executions  > 0
AND    buffer_gets > 0
AND    (buffer_gets - disk_reads) / buffer_gets < 0.80
ORDER
    BY 4 desc ;


SELECT sql_text, executions, 
       round(disk_reads / executions, 2) reads_per_run,
       disk_reads, buffer_gets, 
       round((buffer_gets - disk_reads)
           / buffer_gets, 2) hit_ratio, 
       sql_text
FROM   v$sqlarea
WHERE  executions  > 0
AND    buffer_gets > 0
AND    (buffer_gets - disk_reads) / buffer_gets < 0.80
ORDER   
    BY 3 desc ;
