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 reg query on DYNALLOC feature raghuraman123 SYNCSORT 12 Wed Jan 10, 2018 2:42 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 4 Tue Nov 07, 2017 8:34 pm

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