Why so slow DB2 SP

Posted on 2012-08-10
Medium Priority
Last Modified: 2012-08-27
Hey I have a simple DB2 SP?   Basically it is just a simple update procedure

It checks if a record exist.

if it exist, depending on content of parameters, construct in a string the update statement

Prepare and Execute it.

Just wondering why is it slow.

Any ideas, suggestions?
Question by:hongning2009
LVL 37

Expert Comment

ID: 38281763
can you post here the code? (the update statement that is executed, not the code that generates it)
LVL 18

Expert Comment

by:Dave Ford
ID: 38282215
How long does the update statement take if you run it interactively? (outside of the stored proc)

How many rows are in the table? Is there an index over the columns in the WHERE clause?

Have you stepped through the code line-by-line to determine the exact statement that takes the excess time?

Sorry to bombard you with seemingly "obvious" questions, but you'd be amazad at how often people forget "the basics".

-- DaveSlash
LVL 27

Accepted Solution

tliotta earned 1000 total points
ID: 38284611
If we can't see the code, it'll just be guesses why it's slow. Please post the code. If code isn't available for posting, you might use google to search for {db2 slow SP} and start trying everything that shows up. I'm not sure any better answer is available.


Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Integration Management Part 2
Loops Section Overview
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question