Results 1 to 4 of 4

Thread: cost of query

  1. #1
    Join Date
    Mar 2008

    Unanswered: cost of query

    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

  2. #2
    Join Date
    Jan 2007
    Jena, Germany
    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

  3. #3
    Join Date
    Apr 2008
    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.

  4. #4
    Join Date
    Mar 2008
    thanks folks....
    Kuper,send me that script

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts