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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Index usage question

Re: Index usage question

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Mon, 23 Jun 2003 09:59:26 -0700
Message-ID: <3EF731EE.B79E129F@exxesolutions.com>


MThomas wrote:

> Good morning:
>
> I am having some difficulty understanding the behaviour of Oracle 9i
> (9.2.0.2 on Windows 2000 Server) during a retrival.
>
> The query is in the form:
> SELECT * FROM iohistory
> WHERE ioid IN (63515, 63516)
> AND reportdatentime >= '25-Mar-2003'
> AND reportdatentime < '21-Jun-2003'
>
> When the query is executed for one or two ioid values , the proper index is
> used. However when a third point is addes to the retrieval a full table
> scan is initiated (this is a problem as the table currently contains
> ~60,000,000 records). Ideally it would always (or nearly always) use the
> index.
>
> The index is unique on the ioid and reportdatentime columns of the table.
>
> Would anyone have an idea how I may correct this behaviour?
>
> Thanks for your help.
>
> Mark.

Are you keeping statistics current for the CBO with DBMS_STATS? What is the EXPLAIN PLAN with three?
Have you tried hints?

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Jun 23 2003 - 11:59:26 CDT

Original text of this message

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