Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Performance Problem with PL/SQL (v2.1) Code
I have a PL/SQL (V2.1) code which portion of it is as
.
.
TYPE freqs_typ_tab IS TABLE OF NUMBER(14,14)
INDEX BY BINARY_INTEGER;
TYPE tps_typ_tab IS TABLE OF NUMBER(2)
INDEX BY BINARY_INTEGER;
freqs_var freqs_typ_tab;
p2_tab tps_typ_tab;
.
.
FOR n IN 1..79 LOOP IF s2 = '+' THEN freqs_var(n) := p2_tab(n)/100; ELSE freqs_var(n) := 1 - p2_tab(n)/100; END IF; IF s3 = '+' THEN freqs_var(n) := freqs_var(n) * p3_tab(n)/100; ELSE freqs_var(n) := freqs_var(n) * (1 - p3_tab(n)/100); END IF; .
.
.
.
IF s30 = '+' THEN freqs_var(n) := freqs_var(n) * p30_tab(n)/100; ELSE freqs_var(n) := freqs_var(n) * (1 - p30_tab(n)/100; END IF; END LOOP;
Program works fine until it gets to this successive condition check and multiplications. Just single loop thru takes almost 5 seconds! even though everything are already read into the memory and I need to use this very frequently. Any ideas how I can improve it? Should I do it with ProC? Thanx in ad.
Adam Tadj Received on Wed May 14 1997 - 00:00:00 CDT
![]() |
![]() |