How does SQL Server generate a query execution plan that adds up to 6,000%? Today I was on The Heap and was looking at a query plan for something I thought could be improved. However, it created something that shook my belief in the SQL Server query optimizer. Can I still trust sql-server if it cannot even count to 100%?

Characteristics of the table:


clustered on a non-identity column
12 indexes, one of them being the date_entered column in question
60,000 records
26 columns of various types and length
PAGE compressed table


Has anyone seen this before and what causes the plan to look so skewed?


And below from SQL Sentry Plan Explorer
This bug has been known for years, and won't ever be fixed. I first reported it 6 years ago but it has existed far longer than that. These are just estimated costs and don't really have any bearing on the optimizer itself and whether you can trust it. It's simply the showplan output that has some questionable math.


Connect #267530
Connect #370798
Connect #436184
Connect #621330


Solution: use SentryOne Plan Explorer, which tends to get the math right (or simply stop looking at estimated costs and look at more meaningful metrics). If you open this plan in Plan Explorer, the percentages will add up correctly.