We recently stumbled on a scenario where if a plan uses TOP and parallelism, with a low enough DOP, SET STATISTICS IO ON produces incorrect and unreliable information. Thanks to Steve Wright and Thomas Stringer for helping me narrow in and focus on the true issue. Note that DBCC SETCPUWEIGHT is present only to ensure a parallel plan is used for this quite simplistic repro.USE AdventureWorks2012;GOSET NOCOUNT ON;SET STATISTICS IO ON;DBCC SETCPUWEIGHT(1000) WITH NO_INFOMSGS;GO-- STATISTICS IO shows 4 logical reads, trace shows 420:SELECT TOP 15000 * FROM Sales.SalesOrderHeader WHERE OrderDate < '20080101';-- STATISTICS IO and trace both show 333 logical reads:SELECT TOP 15000 * FROM Sales.SalesOrderHeader WHERE OrderDate < '20080101' OPTION (MAXDOP 1);DBCC SETCPUWEIGHT(1) WITH NO_INFOMSGS;
Product Language
Version
Category
Operating System
Operating System Language
Steps to Reproduce
Actual Results
Expected Results
Platform
Virtualization