concept tempdb in category sql

This is an excerpt from Manning's book SQL Server DMVs in Action: Better Queries with Dynamic Management Views.
Often servers contain many databases, and the server’s resources are shared among these databases. This means that no matter how optimized a given database is, its queries could still perform suboptimally because another database on the server is running poorly and hogging the server’s shared resources. These shared resources include CPU, memory, and tempdb. Because of this, where possible, you should consider all the databases on the server when you inspect the DMVs, with a view to improving performance.
As part of the normal housekeeping tasks, it makes sense to regularly check tempdb for space usage. Recording this over a period of time will allow you to plan for future space usage before it becomes an urgent problem that needs to be fixed.
The script I use to find the amount of space (total, used, and free) in tempdb is shown in this listing.
Listing 9.1. Amount of space (total, used, and free) in tempdb
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT SUM(user_object_reserved_page_count + internal_object_reserved__page_count + version_store_reserved__page_count + mixed_extent_page_count + unallocated_extent_page_count) * (8.0/1024.0) AS [TotalSizeOfTempDB(MB)] , SUM(user_object_reserved__page_count + internal_object_reserved__page_count + version_store_reserved_page_count + mixed_extent_page_count) * (8.0/1024.0) AS [UsedSpace (MB)] , SUM(unallocated_extent_page_count * (8.0/1024.0)) AS [FreeSpace (MB)] FROM sys.dm_db_file_space_usageThe script calculates the total size of the tempdb database space by summing the value of the following columns, across all the files that make up tempdb:
The output in this example shows that the total size of tempdb is about 98 gigabytes (100857.5/1024), of which about 1 gigabyte is currently being used, and 97 gigabytes are unused.
Monitoring this output over time will allow you to determine the pattern of tempdb usage, perhaps identifying periods when it’s nearing its size limit. In this case, it makes sense to preempt the file growth and expand tempdb before an increase is needed. I’ve experienced several occasions where the client code (for example, a .NET client) has terminated with a timeout error because the database has been busy growing its files.

This is an excerpt from Manning's book SQL Server MVP Deep Dives.
In SQL Server 2005, Microsoft added in something called SNAPSHOT isolation level. In SNAPSHOT isolation level, when you start a transaction, all the data you read will look exactly as it did when you started the transaction. Currently executing processes don’t lock you out; they maintain the previous version for anyone who wants to see it. This is a nifty way to implement a system, but it presents some difficulties for modifying data—you really have to consider how the SNAPSHOT isolation level will affect your queries and applications. SNAPSHOT transaction isolation uses row versioning to store the before image of the data in tempdb, so fully understanding the impact on your hardware is very important.
Avoid putting tempdb on a RAID 5 I/O subsystem, because tempdb is subject to heavy writes, and RAID 5 often offers poor write performance.