Skip to content

Instantly share code, notes, and snippets.

@RichVRed
Forked from ryanthames/full_scans.sql
Created April 28, 2017 23:56
Show Gist options
  • Select an option

  • Save RichVRed/cf5ff4851f2ea2bab1325ac1caa89e60 to your computer and use it in GitHub Desktop.

Select an option

Save RichVRed/cf5ff4851f2ea2bab1325ac1caa89e60 to your computer and use it in GitHub Desktop.
select pl.object_owner, pl.object_name,
pl.sql_id, q.sql_text, q.module,
pl.operation, pl.options, pl.cost, pl.cpu_cost, pl.io_cost,
q.executions
from v$sql_plan pl, v$sql q
where pl.sql_id = q.sql_id
and ((pl.operation = 'TABLE ACCESS' and pl.options = 'FULL')
or (pl.operation = 'INDEX' and pl.options = 'FAST FULL SCAN')
or (pl.operation = 'INDEX' and pl.options = 'FULL SCAN (MIN/MAX)')
or (pl.operation = 'INDEX' and pl.options = 'FULL SCAN'))
order by pl.object_owner, pl.object_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment