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: Performance Tuning.

Re: Performance Tuning.

From: Satish <satishsanthanam_at_yahoo.com>
Date: 24 Oct 2004 19:40:32 -0700
Message-ID: <d04d15e8.0410241840.27dc4f3@posting.google.com>


Sybrand Bakker <sybrandb_at_hccnet.nl> wrote in message news:<23ven01envee490lem3c2qi0venov85v2j_at_4ax.com>...
> On 21 Oct 2004 01:14:35 -0700, satishsanthanam_at_yahoo.com (Satish)
> wrote:
>
> >Hi,
> >
> >I have a loop control structure as below. This seem to take a lot of
> >time. Is there any way by which I can improve the performance by
> >changing the loop control structure..
> >
> > for v_Counter in 1..v_schedule.count loop
> > v_CouponRecord := v_schedule(v_Counter);
> > if (v_CouponRecord.pay_date >= i_start) Then
> > i_t := calculate_years_between_ytdt(i_start,v_CouponRecord.pay_date,security_record,v_schedule,
> >FALSE);
> > if ( i_eType = eFactor) then
> > nfactor := factor(i_r,i_t,
> >security_record.yield_frequency);
> > end if;
> > if (i_eType = eDFactor) then
> > nfactor := dFactor(i_r,i_t,
> >security_record.yield_frequency);
> > end if;
> > couponAmount :=
> >getCouponAmount(v_CouponRecord.pay_date,security_record,v_schedule);
> > if (v_CouponRecord.pay_date = security_record.maturity_date)
> >then
> > couponAmount := couponAmount + 1.0;
> > end if;
> > total := total + couponAmount * nfactor;
> > end if;
> > end loop;
> >
> >Thanks,
> >Satish
>
>
> Difficult to see due to line wrapping.
> However, you seem to reject records procedurally you have already
> selected (if (v_CouponRecord.pay_date >= i_start) Then)
> so it looks like you need to modify you sql (guideline: never do
> anything procedurally you can do using sql)
> You could also change the two tests on i_etype into an if then elseif
> structure.

Thank you for your valuable suggestion.
Regards,
Satish Received on Sun Oct 24 2004 - 21:40:32 CDT

Original text of this message

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