Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Performance Tuning of Db2 Query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
tweety25

New User


Joined: 16 Mar 2007
Posts: 3
Location: India

PostPosted: Thu May 17, 2007 9:38 am    Post subject: Performance Tuning of Db2 Query
Reply with quote

We have 3 cursors in a program as follows:

open cursor1
Fetch the records
do when not sqlcode 100
open cursor2
fetch cursor2
process
close cursor2

open cursor3
fetch cursor3
process
close cursor3
end do
close cursor1
Write to an output file.

We have to reduce the time taken for excution. It takes atleast 20 mins to execute the program.
Will the Option of Opening all the cursors at one time, processing the record set and then at end close all the cursors instead of Open, fetch and close help?
Is there any other way?
Please let me know.
Back to top
View user's profile Send private message

raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Sat May 19, 2007 9:15 pm    Post subject: Performance Tuning of Db2 Query
Reply with quote

first two cursors can be comnined to one. because 2nd is depend on 1st one.

the third cursor is like a stand alone cursor. this can be modified depending on the actual functionality of the program.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue May 22, 2007 5:31 am    Post subject:
Reply with quote

Hello,

How many rows need to be fetched from each table for processing this program?

How many of the predicates are via a key/index?

What do the select statements with the 3 curssors look like?

How often and at what time(s) is this program run?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts CONTIG for performance? JPVRoff JCL & VSAM 8 Fri Jun 09, 2017 8:39 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us