SET STATISTICS IO ON/OFF Command

Let us look at the STATISTICS IO output for the example of the query. This is a session level setting STATISTICS IO provides you with I/O related information for the statement you run.
DBCC DROPCLEANBUFFERS
GO
SET STATISTICS IO ON--This is session level command
GO
SELECT SalesOrderID,OrderDate,CustomerID
FROM dbo.New_SalesOrderHeader
GO
SET STATISTICS IO OFF

If we run the above command in AdventureWorks2008 database we will get the results as below

Table ‘New_SalesOrderHeader’.
Scan count 1,
logical reads 799,
physical reads 0,
read-ahead reads 798,
lob logical reads 0,
lob physical reads 0,
lob read-ahead
reads 0.


Scan Count: Scan count tells you that how many times the table was accessed for this query.
Logical Reads: This counter indicates that how many pages were read from data cached. In this case total 799 pages read from data cache.
PhysicalReads: This counter indicates that the number pages read from the disk here it is 0 that means there is no physical read from the disk
Read-Ahead Reads: This counter indicates that number of pages from physical disk that were placed into the internal data cache when sql server guess that you will need them in the query.And here it is 798,which means that many physical reads. Both Physical read and read-ahead-reads counter indicates the amount of physical disk activity. The log logical reads,lop physical reads,and lob read ahead reads are the same as other reads but these counters indicates reads from large objects.
VARCHAR(MAX),NVARCHAR(MAX),XML or VARBINARY(MAX)
 
 
 

 

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server