SQL 2005 provides Dynamic Management Views (DMV). One of these is sys.dm_os_wait_stats, which can be queried to give information about waits encountered by threads that are in execution. This information can be used to evaluate performance issues with SQL Server or, even more granularly, with specific queries.
To query this view, you must have VIEW SERVER STATE permission.
The columns available in this view are:
wait_type – Name of the wait type
waiting_tasks_count – Number of waits on the wait type
wait_time_ms – Total wait time for the wait type in milliseconds
max_wait_time_ms – Maximum wait time for the wait type in milliseconds
signal_wait_time_ms – Difference between the time the waiting thread was signaled and when it ran
Future posts will examine how to utilize this information to performance tune SQL queries.