Wednesday 7 September 2011

Checking logical reads of TSQL statements

Use the following statistics statements to check the logical reads and other performance stats when running a SQL Statement.
set statistics io on
set statistics time on

SELECT * FROM MyTable
set statistics io off
set statistics time off

Another trick for comparing equivalent sql statements, is to run them both with the execution plan on, and then compare the relative cost to the batch in the resulting execution plans of each statement.

No comments:

Post a Comment

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...