Skip to content

Instantly share code, notes, and snippets.

@ryanthames
Created April 1, 2016 14:38
Show Gist options
  • Save ryanthames/69a9dc6d7319de415520b170feb460fa to your computer and use it in GitHub Desktop.
Save ryanthames/69a9dc6d7319de415520b170feb460fa 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