Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1226
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
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us