Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL-statment tuning

Re: SQL-statment tuning

From: David Sisk <davesisk_at_ipass.net>
Date: Fri, 17 Apr 1998 21:02:28 GMT
Message-ID: <ErPZ.4$P3.123687@news.ipass.net>


"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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US