0

So I'd like to create a query that allows to use indexes, but don't allow to use bitmap indexes. How can I do that?

example:

--1. use indexes

select /*+ index(sz) index(c)  */  * 
from szallit sz natural join cikk c
where pkod = 10;

--2. use indexes, but no bitmap indexes

select /*+ ?  */  * 
from szallit sz natural join cikk c
where pkod = 10;

1 Answers1

0

You can use NO_INDEX hint in Oracle and explicite exclude an index. E.g. NO_INDEX(emp hiredate). There can be multiple excluded indexes for a table.

https://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements006.htm#SQLRF50411

Marcin Badtke
  • 599
  • 5
  • 9
  • Yes, I know that, but my problem is when I have more bitmap indexes, and I don't want to write their name explicitly( or I don't know their name, because of someone else will create another bitmap index).. So I'd like to disallow ALL bitmap indexes and allow all other indexes – Viktor Habony Dec 07 '19 at 10:05
  • I understand now but not aware of such a hint. The only thing I can come up with now is to select bitmap indexes' names for particular table from all_indexes view and use dynamic SQL to construct up to date hint NO_INDEX. – Marcin Badtke Dec 07 '19 at 19:48