Bad Estimated I/O Cost
2014-07-11 21:01:03
I have three queries that get the same results but the estimated cost I/O is wrong in the first querie. In SQL Sentry Plan the estimated cost is 0.00 but in SQL SERVER MANAGEMENT STUDIO the estimated cost is 617,712 (queries use a filtered index)
Please excuse my limited English
–// ACTUAL CODE
SELECT TOP 1 d.[Id] FROM t1 AS d WHERE d.Status = 8 ORDER BY d.[Id] SELECT TOP 1 d.[Id] FROM t1 AS d WITH(FORCESEEK) WHERE d.Status = 8 ORDER BY d.[Id] SELECT MIN(d.[Id]) FROM t1 AS d WHERE d.Status = 8
VERSION:Microsoft SQL Server 2008 (SP3) – 10.0.5829.0 (X64) Jan 5 2013 16:00:13 Copyright (c) 1988-2008 Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) (VM)