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: 1224
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: 1239
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 Join in SQL Query vickey_dw DB2 0 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts DD DUMMY & CPU TIME Nileshkul Testing & Performance analysis 16 Mon Dec 19, 2016 11:35 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am


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