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: indexing a column with only 2 or 3 values

Re: indexing a column with only 2 or 3 values

From: William Robertson <williamr2019_at_googlemail.com>
Date: Sat, 04 Aug 2007 04:35:26 -0700
Message-ID: <1186227326.171460.134940@r34g2000hsd.googlegroups.com>


On Aug 3, 9:47 am, ciapecki <ciape..._at_gmail.com> wrote:
> On 3 Aug., 10:21, Helma <bad_elef..._at_hotmail.com> wrote:
>
> > > > >>> Does indexing a very big table (about 5Mio records) on the columnA
> > > > >>> which can hold only values Y,N,<NULL> make sense?
> > > > >> Yes, that's what bitmap indexes were made for.
>
> > FYI , you can also index only the N ( or Y) value's in the column.
> > This is done if e.g. the boolean is an indicator whether a row has
> > gone through a processing run or not, and the application just need to
> > find the N values.
> > Bitmap indexes are not ok if the table is updated intensively.
>
> > Helma
>
> Hi Helma,
>
> It will be actually a view and will be refreshed everyday (once a
> day).
> But thanks for the warning.
>
> BTW. how can you index only N's for example?
>
> chris

Ideally you might arrange the design such that the small number of rows you typically want to identify are flagged with a 'Y' (say) and the rest left null. Then a standard btree index on that column would be compact and efficient. This might also work for Y/N/NULL if the null values formed the vast majority, although I would be interested to know what nulls represent in a Yes/No column. Received on Sat Aug 04 2007 - 06:35:26 CDT

Original text of this message

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