How do i calculate/compare Query COST (xx%)?

  • Hi!

    Could someone explain how can i calculate (and compare) the COST (in percent values) when running 2 diferent queries, both achiving the same result?

    I've been reading about performance tips, and all refer that "if you do this (...) you'll get a 30% speed up...)" but i cant actualy see that diference anywhere!

    Query analizer only shows "Estimated Subtree cost: 1,0000000%" for each operation: should i SUM all the "Estimated costs" ???

    Or there is any king of formula to calculate the total cost, therefore providing a base value to compare to other execution plans?

    Thanks!

    @Rodrigues

    labdev@netcabo.pt

    arodrigues@banifserv.pt


    LabDev

    labdev@iol.pt

  • I usually do two things.

    1. Measure the time (use select getdate() around the queries) on the server or client.

    2. Check the subtree cost. The percentage cost will always be 1 for the final step because all steps have added to 100%. You can use this to check indivual steps to get their percentage.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

  • Hi, Steve!

    I can't fully understand that...

    It means that i must read, say, from right to left (steps), while calculating individual percentages of all steps???

    @Rodrigues

    labdev@netcabo.pt

    arodrigues@banifserv.pt


    LabDev

    labdev@iol.pt

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

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