Home Dashboard Directory Help

Sum of operator costs is more than 100% (in the execution plans) by Razvan Socol


 as By Design Help for as By Design

Sign in
to vote
Type: Bug
ID: 621330
Opened: 11/12/2010 2:47:39 AM
Access Restriction: Public
User(s) can reproduce this bug


For certain queries, the sum of "Estimated Operator Cost" (as a percent) is more than 100%.
Sign in to post a comment.
Posted by Microsoft on 11/17/2010 at 5:28 PM
Dear Customer,

Thanks for taking the time to file this observation and simple repro. The strange cost percentage values that you observed are an aritifact of the specific structure of the query plan that are a bit confusing but ultimately do make sense. They will not adversely affect the running of the query in any way.

The concatenation operator has two children - the table scans. However the server expects that it will not be necessary to execute the second table scan. This is because it expects to find a row from the first table scan which would satisfy the "exists" part of the query. Therefore it does not include the cost of the second table scan when computing the total cost of the subtree rooted at the concatenation. However it still estimates and reports the cost of the second table scan, which the management tool the computes as a percentage of the total query cost as if it will be executed.

In this case of course, it would be necessary to run the second table scan since the first is empty. However the engine operates on the conservative assumption that there will always be at least one row (which may only have been added after the query was compiled).

SQL Development
Sign in to post a workaround.