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: How to tune up this simple query

Re: How to tune up this simple query

From: Miguel Camba <M.CAMBA_at_terra.es>
Date: Fri, 01 Feb 2002 00:02:10 GMT
Message-ID: <3c59daec.4509789@news.terra.es>


Use tips

On 28 Jan 2002 13:29:45 -0800, ewong_at_mail.com (Ed Wong) wrote:

>I have this table named testresult with 10 million records:
>id number(10) --pk, indexed
>testid number(10) --fk reference to test.id, indexed
>result varchar2(100)
>
>The following query takes 20 seconds:
>select min(id) from testresult where testid > 100000;
>
>I have a program that does this query in a loop(because testid keep
>changing). So 20 seconds is not acceptable.
>
>How to tune this up? How come it doesn't use index of testid? The
>explain plan shows it's doing a full table scan instead of using index
>of testid.
>
>Thanks,
>ewong
Received on Thu Jan 31 2002 - 18:02:10 CST

Original text of this message

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