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: optimize this query

Re: optimize this query

From: Robert Klemme <bob.news_at_gmx.net>
Date: Thu, 1 Dec 2005 11:37:46 +0100
Message-ID: <3v823uF14hhroU1@individual.net>


Sreelal wrote:
> in the following qry,
>
> SELECT D_RIF_SALD FROM
> (SELECT DISTINCT D_RIF_SALD FROM GP_TR_CONTR_VAR ORDER BY 1 DESC)
> WHERE ROWNUM <= 3;
>
> Suppose the table contains >1 crore records the query will be slow as
> we are
> using Distinct on a column which repeats . Now it takes > 80 secs
> Any idea to make the query fast

Checkout the execution plan. Do you have an index on D_RIF_SALD?

    robert Received on Thu Dec 01 2005 - 04:37:46 CST

Original text of this message

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