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

Home -> Community -> Usenet -> c.d.o.tools -> Re:Indexing NULL values

Re:Indexing NULL values

From: Cremieux, Judith K. (ISFPC) <JKCREM_at_exchange.inland.com>
Date: Thu, 8 Mar 2001 08:46:11 -0600
Message-ID: <B2BC5A4F0D0AD311A21C00805FC76E9201850646@sypointcast.inland.com>

In the Oracle Tuning documentation it states:

Indexing Null Values

Bitmap indexes index null values, whereas all other index types do not. Consider, for example, a table with STATE and PARTY columns, on which you want to perform the following query: SELECT COUNT(*) FROM people WHERE state'CA' and party !'R';

Indexing nulls enables a bitmap minus plan where bitmaps for party equal to 'R' and NULL are subtracted from state bitmaps equal to 'CA'. The EXPLAIN PLAN output would look like this: SELECT STATEMENT

  SORT                    AGGREGATE 
    BITMAP CONVERSION     COUNT 
      BITMAP MINUS 
        BITMAP MINUS 
          BITMAP INDEX    SINGLE VALUE    STATE BM 
          BITMAP INDEX    SINGLE VALUE    PARTY BM 
        BITMAP INDEX      SINGLE VALUE    PARTY BM 


Note that if a NOT NULL constraint existed on party the second minus operation (where party is null) would be left out because it is not needed.

> -----Original Message-----
> From: Mike Fotiou [SMTP:mfotiou_at_magma.ca]
> Posted At: Tuesday, March 06, 2001 10:30 PM
> Posted To: misc
> Conversation: Indexing NULL values
> Subject: Indexing NULL values
>
> Hi,
>
> Is there any way to index null values in Oracle? Does the BITMAP
> type
> index include NULL values? We have several searches which use IS
> NULL/IS
> NOT NULL conditions. Currently, the Table Scan that Oracle uses is
> killing
> query performance. These fields do not really lend themselves to
> default
> values (e.g. a closing date). In SQL Server, there is the ability to
> include NULLS when the index is built. Is there any such feature in
> Oracle
> 8/8i?
>
> Mike
>

--
Received on Thu Mar 08 2001 - 08:46:11 CST

Original text of this message

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