IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to check execution time of SQL query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1353
Location: Israel

PostPosted: Tue Oct 06, 2009 6:53 pm
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: 1020
Location: India

PostPosted: Tue Oct 06, 2009 8:19 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts SCOPE PENDING option -check data DB2 2
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top