Tuning Stored Procedures, Subtree cost, cpu, reads

  • Does anyone know how exactly the sub-tree cost is calculated and whether it is a sufficient metric for measuring query/stored procedure performance?

    I used to think (although I could never find a single definitive source to state it clearly and precisely) that a sub-tree cost is some function of (reads + cpu time). However, my recent experience appears to challenge this belief.

    Namely, I have a few versions of a stored procedure, where each version does the same thing, but differently.

    Ver 1: # reads = 2 million and cpu_time = 19,707 and sub-tree cost = 0.1171

    Ver 2: # reads = 1.5 million and cpu_time = 4,371 and sub-tree cost = 0.13

    Ver 3: # reads = 154,000 and cpu_time = 935 and sub-tree cost = 0.25

    Ver 4: # reads = 165,000 and cpu_time = 230 and sub-tree cost = 0.228

    If I assume the sub-tree cost to be the benchmark, then I should go with Version 1. However, looking at other parameters, it it obviously the worst choice.

    So, the question is, what is the best benchmark for judging performance ?

    Thanks a lot

  • This was removed by the editor as SPAM

  • An another website I was suggested to look at the following website, which does have a lot of information on the subject:

     

    http://www.sql-server-performance.com/joe_chang.asp

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply