5 pts.
 Internal vs Externa Stored Procedure Performance
Our company develops software for Windows using C# for connecting and updating the corporate database in DB2/400. We use both internal (SQL) and external (rpg) stored procedures. Because we have noticed some bad performance in our internal stored procedures, we have the following question: Is there any diference in performance between internal vs external stored procedures? What is the best? Are they the same when you talk about performance?

Software/Hardware used:
ASKED: July 10, 2008  2:18 AM
UPDATED: May 4, 2010  6:46 AM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

It depends on what they’re doing. External (RPG, COBOL, C, etc.) procedures are obviously best when you need things done that SQL has difficulty with.

Complex, detailed business logic can be much better suited to a procedural language. Set processing (where appropriate indexes exist) will be better suited for SQL procedures.

Either way, testing for performance should lead to the appropriate solution in each case. Also, quality programming will always make a difference.

If you can work out SQL procedures that can replace a poor performing RPG procedures, why would you not use them? OTOH, if a SQL solution requires bending the language just to get an accurate result or if development resources are better spent elsewhere, why would you waste the effort?

Tom

 108,205 pts.