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
 
DB2 query tuning

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

New User


Joined: 16 May 2008
Posts: 36
Location: Kolkata,India

PostPosted: Mon Apr 05, 2010 1:29 pm    Post subject: DB2 query tuning
Reply with quote

Hi,

I have a DB2 query for fetching transactions from multiple tables.The query is inbuilt in a COBOL pgm.The joins of the tables are in order of their primary key/indexes.Still the query is taking around 7 hours to execute.
May I request for any insight on how can I optimize this query.I also tried multi-row fetch but that won't help much.

Please let me know if putting up the query would help in providing the resolution.Thanks a lot.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10350
Location: italy

PostPosted: Mon Apr 05, 2010 1:41 pm    Post subject: Reply to: DB2 query tunning
Reply with quote

from what I can see Your query works perfectly, I just tested a similar query and the results were
quick and dirty 4 days an 19 hours ( z/OS + DB2 )
after optimization ( praise to the system, I did not do anything really ) 9 hours ( OS/VU )

so You see, after all You were able to find a better optimization, congratulations
I am going to make a formal complaint to the OS/VU designers

I was able to post all this useful info ( along Your judgment of useful ) because today is psychic day,
and above all because I run a very smart operating system.. OS/VU

here is the optimized query

Code:
//seventhday exec pgm=iehprophet,parm='usetimewarp'
//steplib dd disp=resurrect,dsn=sys1.messiahscripts
//whatIwouldlike dd *
 run the query i have in mind in the shortest time -
 providing consistent results
//whereputtheresult dd subsys=I_will_let_you_know_when_I_remember

the usetimewarp parm offloads the long running tasks to a zTWP ( time warp processor )
in order to reduce the elapsed to a few minutes ( as You can see fro the reply timestamps )

the 4 days timing was obtained by using a zOS emulated machine under OS/VU

I wish I could tell the details, But I signed a NDA icon_sad.gif
Back to top
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 94
Location: India

PostPosted: Mon Apr 05, 2010 4:41 pm    Post subject: Reply to: DB2 query tuning
Reply with quote

@Kamlesh

Post the query please.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Apr 05, 2010 4:46 pm    Post subject: Re: DB2 query tuning
Reply with quote

Kamlesh Kamal wrote:
Please let me know if putting up the query would help in providing the resolution.

to summarize Enrico's answer : Duh !

the query, explain info and the definition/stats of the involved (or alternative) indexes
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: Mon Apr 05, 2010 8:13 pm    Post subject: Reply to: DB2 query tuning
Reply with quote

Only Monday morning and already another topic of the "my results are not acceptable, i don't want to post any specifics, and i want suggestions about how to improve my process" variety. . . icon_confused.gif

Maybe some of the requested info will be posted so someone might be able to help. . .

d
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 Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 3 Tue Nov 07, 2017 8:34 pm
No new posts Query on XMITIP abdulrafi All Other Mainframe Topics 1 Wed Oct 25, 2017 6:54 pm
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

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