locked
What does "Estimated Operator Cost" mean? RRS feed

  • Question

  • Hi all,

    In estimated execution plan (CTRL+L), what does "*** Cost" mean? Means time in second?
    For example,
    Estimated Operator Cost: 0.443134
    Does it mean this operator will spend 0.443134 second to perform this operation?

    But I saw this statistic is different (much smaller) than "elapsed time" by SET STATISTICS TIME ON. Why?


    Thanks.
    • Moved by Tom Phillips Wednesday, June 24, 2009 2:04 PM TSQL Question (From:SQL Server Database Engine)
    • Edited by Santosh Kumar Nair Friday, June 26, 2009 6:32 PM fixing thread title bug
    Wednesday, June 24, 2009 6:00 AM

Answers

All replies

  • No, this is not seconds. It is really just a weighted value used by the optimizer so it can compare different potential plans (strategies). Mostafa explains this much better than I do:

    http://blogs.msdn.com/sqlqueryprocessing/archive/2006/10/11/What-is-this-cost.aspx
    Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi
    • Marked as answer by Alex Song Friday, June 26, 2009 5:35 AM
    Wednesday, June 24, 2009 7:01 AM
  • Hi Alex,


    Estimated Operator Cost means

    The cost to the query optimizer for executing this operation. The cost of this operation as a percentage of the total cost of the query is displayed in parentheses. Because the query engine selects the most efficient operation to perform the query or execute the statement, this value should be as low as possible.

    Estimated I/O Cost

    The estimated cost of all I/O activity for the operation. This value should be as low as possible.

    Estimated CPU Cost

    The estimated cost of all CPU activity for the operation.


    SQL Server Execution Times:

    CPU time = 14109 ms, elapsed time = 94697 ms.

     

    The elapsed time is total query execution time this include CPU Time .Total time here is 94.697 secs.

    This diffrence include population of execution plan, other activities and population of data.




    Mohd Sufian www.sqlship.wordpress.com Please mark the post as Answered if it helped.
    Wednesday, June 24, 2009 7:17 AM
  • Thank you all.

    That artical is so useful!!!
    Friday, June 26, 2009 5:36 AM