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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Index Behaviour

Re: Index Behaviour

From: Gregory Conron <gconron_at_hfx.andara.com>
Date: Fri, 06 Jul 2001 15:59:39 -0700
Message-ID: <F001.00343A79.20010706160024@fatcity.com>

On July 6, 2001 04:51 pm, Mercadante, Thomas F wrote:
> Dave,
>
> I think <> is like using the NOT operator, thus an index can not be
> used.
>
> Think about it - your asking the optimizer to find records in the
> index that are not there - nothing to really search on - so it does
> a FTS.
>
> Now if you did
>
> select surnam from basic where membno between 0 and 9
> or membno between 10 and 10000
>
> it might work as expected.

You also have to realize it may be quicker to do a full table scan. Consider a table with 1000 records, 100 of which are membno 10 - 90% of the table is not #10 - it would be much quicker to do a scan of the table instead of looking up all the records in the index then grabbing the corresponding rows from the table.

Cheers,
GC

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Gregory Conron
  INET: gconron_at_hfx.andara.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Jul 06 2001 - 17:59:39 CDT

Original text of this message

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