Most Popular

SQL Server Table Variables Won’t Perform Quicker than Temporary Tables

There is a common misconception that table variables are in-memory structures and as such will perform quicker than temporary tables. Thanks to a DMV called sys.dm_db_session_space_usage, which shows tempdb usage by session, you can prove that’s not the case. After restarting SQL Server to clear the DMV, run the following script to confirm that your […]

Read More

About the SQL Server Tempdb

The tempdb is the “scratch” database for SQL Server; it’s a temporary data store used by both applications and internal operations. It is does have some unique characteristics that affect how you use and manage it.

Read More

SQL Server Latch Waits

Some SQL Server latches can come into contention with one another. This is intended and necessary as part of the need to serialize access. However, as with locking, this does raise the prospect of blocking, and consequently latch waiting.

Read More

SQL Server Latch Types

There are hundreds of different types of SQL Server latches. Latch waits will occasionally show up in sys.dm_os_wait_stats, but you have to actively search for them.

Read More