Chapter 8

Knowing Tempdb


  • How SQL Server uses tempdb for internal and user-created temporary objects
  • Avoiding and troubleshooting common tempdb issues
  • How to monitor and tune tempdb performance
  • Using configuration best practices to increase the performance and availability of tempdb


The code downloads for this chapter are found at on the Download Code tab. The code is in the Chapter 8 download and individually named according to the names throughout the chapter.


This chapter is about the system database called tempdb, which is used for storing temporary objects and has been a key component of SQL Server since its inception. Beginning with SQL Server 2005, however, the role of tempdb has been brought to the forefront with a plethora of new features and optimizations that depend on temporary objects.

All these features have increased the visibility and requirement for good tempdb performance, which is why we have dedicated a full chapter to a thorough grounding in what it is used for, how to troubleshoot issues, and how it should be configured.

The first section looks at what makes tempdb special, which SQL Server components use it, and specifically how it is used. The next section covers common issues and how to troubleshoot them, which sets the scene for the configuration recommendations that follow. Finally, you’ll find an especially useful best ...

Get Professional SQL Server 2012 Internals and Troubleshooting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.