Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL-statment tuning
"SELECT * FROM table WHERE tab_column = 1" would use a B-tree index if the
selectivity of tab_column is reasonably high OR a bitmap index if the
selectivity of tab_column is very low (<1%). "SELECT * FROM table WHERE
tab_column IS NULL" cannot possibly use an index. If tab_column of row x is
null, then the rowid of row x is not contained in the index, so there's
nothing in the index to read. Try rewriting the statement without using the
IS NULL.
Good luck,
Dave
Jürgen Kling wrote in message <35376D45.16ED_at_w-4.de>...
>Who can help me to optimize the following SQL statment:
>
>select * from TABLE
>where TAB_COLUMN = 1
> or TAB_COLUMN is null
>
>
>the Column TAB_COLUMN havein an index, but Oracle can't use it.
>Thus Oracle do an Full Table scan.
>
>Do somebody now how to change this statement
>
>
>jkling_at_w-4.de
Received on Fri Apr 17 1998 - 16:02:28 CDT