Databases Reference
In-Depth Information
Figure 3-15: Clustered Index Scan operator properties.
Note that, in an older version of SQL Server, the cost used to mean the estimated time
in seconds that a query would take to execute on a specific hardware configuration, but
currently this value is meaningless as an objective unit of measurement, and should not
be interpreted as one.
For a Clustered Index Scan operator, I observed that the CPU cost is 0.0001581 for the
first record, plus 0.0000011 for any additional record after that. Because, in this specific
case, we have an estimated 121,317 records, we can calculate 0.0001581 + 0.0000011 *
(121317 - 1), which comes to 0.133606, which is the value shown as Estimated CPU Cost .
In a similar way, I noticed that the minimum I/O cost is 0.003125 for the first database
page, and then it grows in increments of 0.00074074 for every additional page. Since this
operator scans the entire table, I can use the query in Listing 3-59 to find the number of
database pages (which turns out to be 1,234).
Search WWH ::




Custom Search