Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Logic Reads ... counter makes no sense?

$
0
0

How it is possible that selecting less data causes more logical reads?

SET STATISTICS IO ON
go

SELECT [id]
      ,[filler1]
  FROM [Test1].[dbo].[Tab1]
  Where id = 1

Table 'Tab1'. Scan count 1, logical reads 1, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

==============

SELECT [id]
  FROM [Test1].[dbo].[Tab1]
  Where id = 1

Table 'Tab1'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

==============

Test setup looks as follows:

CREATE TABLE dbo.Tab1
(
id INT NOT NULL,
filler1 CHAR(36) NOT NULL,
filler2 CHAR(216) NOT NULL
);

CREATE NONCLUSTERED INDEX [NonClusteredIndex-20130905-002756] ON [dbo].[Tab1]
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

INSERT INTO dbo.Tab1
(id, filler1, filler2)
VALUES
(1, 'x', 'x');

using SQL Server 2008 R2


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>