RE: How to create index for this query ( bitmap also not solved this issue)

RE: How to create index for this query ( bitmap also not solved this issue)

 

  

Hi,
i need some help/advice from the big-hands people, regarding the
optimization of query and creation of Indexes.


I create one table,
eg:
CREATE TABLE TAB1
( a number, d date, c varchar2(1) );

CREATE INDEX tab1_idx on tab1(d,c);

If i put this codition in where clause

Select * from tab1 where d > sysdate and c is null;
-- Index is access for this query

if i used this query
select * from tabl where ( (d>sysdate and c is null) or ( d
is null and c is null ) ) ;
-- TABLE ACCESS FULL is performed.


what i did was
drop the existing index and create the Bitmap index like

CREATE BITMAP INDEX tab1_idx on tab1(d,c);
if i used this query
select * from tabl where d is null and c is null ;
-- index is accessed

but for this query
select * from tabl where ( (d>sysdate and c is null) or ( d
is null and c is null ) ) ;
******* the same full table is accessed.

How i have to solve this issue ( means, how i have to make the index
)

expect your reply for this.

Thanks,
Sekaran D.
Disclaimer: 'This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error please notify the system
manager. Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those of the
company. Finally, the recipient should check this email and any attachments
for the presence of viruses. The company accepts no liability for any damage
caused by any virus transmitted by this email.'

Oracle LazyDBA home page