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 of stored procedure

Re: performance tuning of stored procedure

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 01 Sep 2006 10:50:13 -0700
Message-ID: <1157133011.392167@bubbleator.drizzle.com>


KK wrote:
> Is there any better way of writing the below stored procedure logic for
> performance tuning? It is taking time for large number of records.
>
> This has 2 for loops. The second loop gets executed (n-1) number of
> times for each record of count n. I appreciate your ideas?
>
> Thanks.

Dump the cursor loops and move to array processing. See the demo in Morgan's Library titled "FAST WAY" (www.psoug.org). Use FOR loops after the BULK COLLECT and before the FORALL to do work in memory.

If the ORDER BY clause is not required getting rid of it will help too.

I would expect getting away from single-row processing with a cursor loop to increase performance by at least 50X.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Sep 01 2006 - 12:50:13 CDT

Original text of this message

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