MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EXECUTE IMMEDIATE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Catherine
Beginner


Joined: 30 Aug 2006
Posts: 32
Topics: 15
Location: Chennai

PostPosted: Fri Dec 07, 2007 8:32 am    Post subject: EXECUTE IMMEDIATE Reply with quote

Hi all,

Please let me know how and when a EXECUTE IMMEDIATE statement is used. Will it help to improve my performance of the Query?
I understand that EXECUTE IMMEDIATE can be used starting from DB2 version 8.
I want to improve the performance of my insert statement as im going to add more columns to my index.
Performance of the insert operation decreases with the no: of columns added in the index as well as the no: of indexes
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Dec 07, 2007 8:53 am    Post subject: Reply with quote

Catherine,

Following is a link that gives you an insight of EXECUTE IMMEDIATE

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAPJ12/6.1.5.1?DT=20050328013405

EXECUTE IMMEDIATE pertains to dynamic SQL. Following link shows the factors determining the performance.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAPJ12/6.1.1.5?DT=20050328013405
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Fri Dec 07, 2007 9:08 am    Post subject: Reply with quote

Depends. Are you using an INSERT with an embedded SELECT? If that's the case and you're adding indexes on the SELECT table, the DB2 optimizer will evaluate current stats and indexes in the PREPARE. Then, if DB2 decides to utilize the new indexes, you would most likely get better performance compared to static SQL bound before the new indexes were created. Adding indexes on the target table would have the same impact on performance no matter how you issue the INSERT.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group