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: Which index to create ?

Re: Which index to create ?

From: Rainer Klomps <Rainer.Klomps_at_t-online.de>
Date: Sat, 13 Dec 2003 23:59:30 +0100
Message-ID: <3FDB99D2.9060407@t-online.de>


The most important question in fact is the question of selectiveness: If you have few distinct values, a bitmap index will help. If, however most of your values are distinct, be happy to use a full table scan, since forcing the database to use indexes by any hint will, besides of the data blocks, also need loading index blocks.

Rainer

André Hartmann schrieb:
> Hi,
>
> I have a question regarding the tuning of one of my SQL statements.
> Suppose there is a table X in my Schema which has columns A, B, C (all
> INTEGER) where A is the primary key. Suppose further that the table is
> pretty large: 10 million rows or more. Quite frequently I want to do this
> statement:
>
> SELECT DISTINCT B FROM X
>
> The explain plan tells me there is a full table scan on X. So I thought it
> might help to create an index on the B column but I still get a full table
> scan. I believe that the full table scan is the main performance
> bottleneck... how can I get rid of the full table scan ?
>
> André
>
>
Received on Sat Dec 13 2003 - 16:59:30 CST

Original text of this message

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