View previous topic :: View next topic
|
Author |
Message |
kutty.r
New User
Joined: 22 Jun 2006 Posts: 24
|
|
|
|
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 |
|
|
raghunathns
Active User
Joined: 08 Dec 2005 Posts: 127 Location: rochester
|
|
|
|
if you execute in qmf you will get the query cost before execution |
|
Back to top |
|
|
kutty.r
New User
Joined: 22 Jun 2006 Posts: 24
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
raghunathns
Active User
Joined: 08 Dec 2005 Posts: 127 Location: rochester
|
|
|
|
i thought you are looking for query cost.
for your question. ekta answer is ok i believe. |
|
Back to top |
|
|
srinivas_y
New User
Joined: 18 Oct 2005 Posts: 1
|
|
|
|
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 |
|
|
raghunathns
Active User
Joined: 08 Dec 2005 Posts: 127 Location: rochester
|
|
|
|
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 |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
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 |
|
|
|