View Single Post

   
  #6 (permalink)  
Old 02-27-2008, 01:04 PM
Tonkuma
 
Posts: n/a
Default Re: stored procedures perf. question

Procedure(External or SQL) needs context exchange. So, you had better
to take into cinsideration both of performance improvement of
procedure itself and overhead of context swithing by using procedure,
at the time of discussing performance.
In DB2 SQL Reference Vol.2 ---> Statements ---> Compound SQL(Dynamic)
written as followings:
Notes:
- Dynamic compound statements are compiled by DB2 as one single
statement. This statement is effective for short scripts involving
little control flow logic but significant dataflow. For larger
constructs with requirements for nested complex control flow or
condition handling, a better choice is to use SQL procedures.
For more details on using SQL procedures, see "CREATE PROCEDURE".

Summarize this phrase:
1) Short scripts involving little control flow logic but significant
dataflow: Dynamic compound statements(and UDF) is effective.
2) Larger constructs with requirements for nested complex control flow
or condition handling: SQL procedures is a better choice.


Reply With Quote