SET STATISTICS

SET STATISTICS TIME [ON|OFF] – Tells how much CPU time and time taken to parse and compile and also the CPU time and elapsed time taken for execution of the SQL statement.

Sample Output:
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 1 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 1 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 1 ms.

SET STATISTICS IO [ON|OFF] – Shows IO statistics when the SQL statement.
scan_count – shows number of times the table is referenced
logical reads – number of pages SQL Server had to read to generate the results.
physical reads – This value would change if the data cache
read-ahead reads – Number of pages placed in cache
lob logical reads – number of varchar(max), nvarchar(max) logical reads from cache
lob physical reads – number of varchar(max), nvarchar(max) physical reads

Sample Output:
Table ‘test_table’. Scan count 1, logical reads 230, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s