Re: SQL Tuning
From: N Prabhakar <prabhs_at_po.pacific.net.sg>
Date: 1997/01/15
Message-ID: <5biivr$1t2_at_newton.pacific.net.sg>#1/1
Date: 1997/01/15
Message-ID: <5biivr$1t2_at_newton.pacific.net.sg>#1/1
binny_at_voicenet.com (Vaneet Gupta) wrote:
>Hi,
>Please suggest me a better way to implement the query.
>
> select sa_qty_rate, sa_ex_date
> into ----
> from sc_scty_act
> where sa_scty = 123
> and sa_activity = 'P'
> and sa_ex_date = (select max(sa_ex_date)
> from sc_scty_act
> where sa_scty = 123
> and sa_activity = 'P'
> and sa_ex_date <= sysdate);
>
>
>>
>Thanks
>
>Vaneet Gupta
Hi,
- Could you try EXISTS instead of a sub query. Normally EXISTS should improve performance.
- Use HINTS /* INDEX index_name */ in the query.
- If you are using COST BASED OPTIMIZER, analyse all the tables before executing the query.
Regards
N.Prabhakar Received on Wed Jan 15 1997 - 00:00:00 CET