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

Home -> Community -> Usenet -> c.d.o.misc -> Re: ** SQL QUERY TUNING

Re: ** SQL QUERY TUNING

From: Kevin P. Fleming <kfleming_at_access-laserpress.com>
Date: Fri, 17 Apr 1998 15:31:54 -0700
Message-ID: <3537D85A.BBDFABAF@access-laserpress.com>


Yes, with Oracle8 you can use bitmap indexes which _DO_ include NULLs. However, unless the column contains the right distribution of data a bitmap index could be disastrous.

kiel wrote:
>
> Jürgen Kling wrote:
> >
> > Who can help me to optimize the following SQL-Statement
> >
> > select * from table
> >
> > where tab_column = 1
> >
> > or tab_column is null
> >
> > Thje column TAB_COLUMN having an index, but ORACLE cant't use it. Thus
> >
> > Oracle do an Full Table scan.
> >
> > jkling_at_w-4.de
>
> From the SQL language Reference manual (Oracle7): "Nulls are not
> indexed"
> (What a bummer, I wasn't aware of that, has that changed with Oracle8?)
>
> That seems to be your problem. If the rowids of rows which contain NULL
> are not kept in the index, there is no way a query can use that index
> to find those rows.
> It seems your only chance to get to use that index is to go back to the
> old days
> and replace the NULLs with -999999 or something, if that's possible in
> your case.
> Of course that will screw up all your group functions like sum avg min
> on that column.
>
> Christian
Received on Fri Apr 17 1998 - 17:31:54 CDT

Original text of this message

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