Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select all indexes of a type in Oracle

How does one go about selecting all indexes of a specific type in Oracle 10g, for instance I want all of the bitmap indexes that are declared.

I imagine the query would be something like this:

select * from system_indexes where type = 'bitmap'

but that is definitely not correct.

like image 810
Woot4Moo Avatar asked Dec 05 '22 11:12

Woot4Moo


1 Answers

SELECT *
  FROM dba_indexes
 WHERE index_type IN ('BITMAP', 'FUNCTION-BASED BITMAP' )

is probably what you're looking for (though you may want just the indexes where index_type = 'BITMAP'. If you are only concerned with indexes on tables that you have SELECT access on, you can query all_indexes rather than dba_indexes. If you are only concerned with indexes in the current schema, you can query user_indexes rather than dba_indexes.

like image 112
Justin Cave Avatar answered Dec 23 '22 09:12

Justin Cave