If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > how to get top 5 time consuming query or cost of query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-08, 02:31
Pawan Kumar Pawan Kumar is offline
Registered User
 
Join Date: Mar 2008
Posts: 120
how to get top 5 time consuming query or cost of query

Hi,
Is there any way to fine out top 5 most time consuming query or top five most cost of query. Please reply ASAP.

I can get info from update statement monitor switch but its very tough to see all query time because there are many query.


Thanks & Regards
Pawan
Reply With Quote
  #2 (permalink)  
Old 03-29-08, 12:53
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
How else could you figure out the top n if you don't want to monitor all queries? How should DB2 collect the information you desire?
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 03-30-08, 14:32
Pawan Kumar Pawan Kumar is offline
Registered User
 
Join Date: Mar 2008
Posts: 120
if i update monitor switch using statement on
then i can get all dynamic quering in particular time and a huge file of many queries....for getting the most time consuming query I need to go through every query time in this file ...that is also time consuming and hectic.

so is there any way in db2 for getting list of top 5 time consuming dyanmic query executed in last 24 hrs???


any command and anything???plz reply ASAP..



thanks
pawan
Reply With Quote
  #4 (permalink)  
Old 03-31-08, 04:19
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
I don't know the structure of the file you mentioned - exactly which steps do you use to collect the information?

Why don't you just use the snapshot table functions to get the statement information, and apply some simple GROUP BY, SUM, and FETCH FIRST clauses to filter the data?
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On