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 > cost of query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-04-08, 08:45
Pawan Kumar Pawan Kumar is offline
Registered User
 
Join Date: Mar 2008
Posts: 120
cost of query

Hi,
Is there any function, procedure or any way to get cost of query from command prompt??

Whats formula for calculating cost of query?

Thanks & Regards
Pawan Kumar
Reply With Quote
  #2 (permalink)  
Old 04-04-08, 09:42
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Use the "db2expln" tool. When creating the access plan, DB2 estimates the costs (in a unit called "timerons"). If you want to get the actual execution times, have a look at "db2batch".

Given the complexity of the DB2 optimizer and the different environment, there will be no way to get an exact formula for query execution costs. Some approximations exist, however. For example, one approach estimates page/index accesses and assigns times to each (like 10 ms per physical page read, .01 ms per logical page read, ...)
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 04-04-08, 22:47
SuperKuper SuperKuper is offline
Registered User
 
Join Date: Apr 2008
Posts: 51
If you have an isolated instance (single- or multi-partitioned) and can arrange to have nothing running there other than the query which you are measuring, I have a script for you to collect actual CPU consumption. Not what snapshot reports, but the real thing.
__________________
db2topgun.com
Reply With Quote
  #4 (permalink)  
Old 04-05-08, 03:55
Pawan Kumar Pawan Kumar is offline
Registered User
 
Join Date: Mar 2008
Posts: 120
thanks folks....
Kuper,send me that script
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