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 can we find the timing of an particular sql query

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

New User


Joined: 22 Jun 2006
Posts: 24

PostPosted: Fri Sep 08, 2006 10:34 pm    Post subject: How can we find the timing of an particular sql query
Reply with quote

hi,

how can we find the timing of an particular sql query. i want to know how long an particular query executed ( how to find ?).
Back to top
View user's profile Send private message

raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Fri Sep 08, 2006 10:39 pm    Post subject: sql timing
Reply with quote

if you execute in qmf you will get the query cost before execution
Back to top
View user's profile Send private message
kutty.r

New User


Joined: 22 Jun 2006
Posts: 24

PostPosted: Fri Sep 08, 2006 10:46 pm    Post subject: timing of query
Reply with quote

i need after executing an query how much time it takes to execute.

for ex: if i execute a query which fetches 1 row it takes xxxxx time to fetch the row . but if i execute a query which fetches 10,000 rows it surely takes more time to fetch the rows . so how to see the exact time taken by each query?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Sep 08, 2006 10:50 pm    Post subject:
Reply with quote

Hi,

Just give the below query before & after ur query in spufi & take out the time difference.

Select current_timestamp
from sysibm.sysdummy;
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Sat Sep 09, 2006 12:06 am    Post subject: timing of query
Reply with quote

i thought you are looking for query cost.

for your question. ekta answer is ok i believe.
Back to top
View user's profile Send private message
srinivas_y

New User


Joined: 18 Oct 2005
Posts: 1

PostPosted: Wed Sep 13, 2006 10:16 am    Post subject: Re: How can we find the timing of an particular sql query
Reply with quote

I dont think the answer is correct.

If you could use explain statement then it would drive you in finding out correct answer.

Let me know if you need further info.

Regards,
S...
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Wed Sep 13, 2006 9:27 pm    Post subject: How can we find the timing of an particular sql query
Reply with quote

explain will give you
how it is accessing the data. which index is used that kind of info.

not the
time taken to extract one row
time taken to extract 1000 rows.
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Wed Sep 13, 2006 10:10 pm    Post subject: Re: How can we find the timing of an particular sql query
Reply with quote

It may be helpful but it uses DB2 so defenetly the time is not true

SELECT CURRENT TIMESTAMP INTO :A-VAR FROM SYSIBM.SYSDUMMY1;

<YOUR QUERY>

SELECT CURRENT TIMESTAMP INTO :B-VAR FROM SYSIBM.SYSDUMMY1;

SUBTRACT A-VAR FROM B-VAR GIVING C-VAR

DISPLAY 'THE TIME OF EXECUTION IS' C-VAR
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 find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
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 SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am


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