finding unused indexes
Hi all,
I have to find unused indexes for a particular table..
I am using below script to findout and remove the unused indexes.
select
p.object_name c1,
p.operation c2,
p.options c3,
count(1) c4
from
dba_hist_sql_plan p,
dba_hist_sqlstat s
where
p.object_owner = 'NAME'
and
p.operation like ‘%INDEX%’
and
p.sql_id = s.sql_id
group by
p.object_name,
p.operation,
p.options
order by
1,2,3;
so what my question is using this output of this script can i remove the indexes which are used very less or not all used.
and also this query gets from views
dba_hist_sql_plan p,
dba_hist_sqlstat s
so may i know how many days data will be there in these views.
so the above query gets the results about index usage of how many days????
Thanks