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: Why Oracle does not use index?

Re: Why Oracle does not use index?

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Wed, 4 Dec 2002 09:21:45 -0000
Message-ID: <3dedc92a$0$232$ed9e5944@reading.news.pipex.net>


"Billy Verreynne" <vslabs_at_onwe.co.za> wrote in message news:ask50l$jvs$1_at_ctb-nnrp2.saix.net...
<skip excellent explanation>
> If you have a SI (secondary index) on STATE and CITY, then that would have
> been used instead of the full table scan.
>
> However - given the number of STATE values, this index is likely a
candidate
> for a bitmap index instead.

Unless the table is subject to frequent inserts and deletes which seems probable to me given the names of the objects.

I'd expect that *for this query* you need to as others have said.

  1. create a secondary index on the company_btr table
  2. Gather stats for the CBO. This query is as Billy said reading each row of the 200,000 row table and looking for matches, One would hope that it would (in the absence of the index folk are suggesting) read the 4000 row table and use that to drive the query, the reason it doesn't is almost certainly that you haven't told Oracle that it is a 200,000 row table.
--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
Received on Wed Dec 04 2002 - 03:21:45 CST

Original text of this message

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