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
 
how to check execution time of SQL query

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

New User


Joined: 14 Sep 2005
Posts: 54
Location: Chennai

PostPosted: Tue Oct 06, 2009 6:23 pm    Post subject: how to check execution time of SQL query
Reply with quote

Hi,
I am running a SQL query in SPUFI.
And I want to know how much time it took to run the query?
Is it possible to know it through SPUFI or do we have any other method to find out the execution time of SQL query?

Thanks in Adv
Sashi
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Tue Oct 06, 2009 6:53 pm    Post subject: Reply to: how to check execution time of SQL query
Reply with quote

Add:
Code:
SELECT CURRENT TIMESTAMP FROM SYSIBM.SYSDUMMY1;
before and after your select statement (";" is the default separator).

Then you will have to calculate the difference between the 2 timestamps.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Tue Oct 06, 2009 8:19 pm    Post subject:
Reply with quote

Sashi,

If you want more accurate infomation, you have to setup PLAN tables, mainly DSN_STATEMNT_TABLE, it gives you information regarding processor costs and stuff like that.

Refer the Performance Monitoring & Tuning Guide for DB2.

Thank You,
Sushanth
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Oct 06, 2009 10:12 pm    Post subject:
Reply with quote

Also, the difference in timestamps will give you elapsed time. CPU time will have to be obtained in a different manner. Running SPUFI online via DB2I on your ISPF panel will give you a relative cost, but the number shown there is only a relative number, not CPU seconds or dollars.
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
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm

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