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 questions

Re: Index questions

From: Greg Moore <sqlgreg_at_pacbell.net>
Date: Wed, 17 Jul 2002 12:51:39 -0800
Message-ID: <F001.0049AA54.20020717125139@fatcity.com>

> If we have a column of 'Y','N' values, the index will
> not help with CBT(usually most of the values are 'N').
>
> My question is : how about bitmap indexes? Should it
> help a lot, or just a little bit?

The issue you are dealing with is skewed data. Most rows have 'N', a few have 'Y'. Your data is not evenly distributed ... it's skewed.

Bitmap indexes are a solution, but not a solution for this issue. What you are looking for is histograms. If they won't work for you (because you're using bind variables) an alternate solution is to code two SQL's in PL/SQL using an IF statement ... IF :x = 'N' then ... execute the SQL that's hinted to not use the index, ELSE execute the SQL that's hinted to use the index.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Greg Moore
  INET: sqlgreg_at_pacbell.net

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 Wed Jul 17 2002 - 15:51:39 CDT

Original text of this message

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