When tempdb is used?

User objects:

  • User-defined tables and indexes
  • System tables and indexes
  • Global temporary tables and indexes
  • Local temporary tables and indexes
  • Table variables
  • Tables returned in table-valued functions

Internal Objects:

  • Work tables for cursor or spool operations and temporary large object (LOB) storage.
  • Work files for hash join or hash aggregate operations.
  • Intermediate sort results for operations such as creating or rebuilding indexes (if SORT_IN_TEMPDB is specified), or certain GROUP BY, ORDER BY, or UNION queries.

Version Stores:

  • Row versions that are generated by data modification transactions in a database that uses snapshot or read committed using row versioning isolation levels.
  • Row versions that are generated by data modification transactions for features such as: online index operations, Multiple Active Result Sets (MARS), and AFTER triggers.

Temp db optimization:

  1. Set the tempdb to single recovery model. Less logs.
  2. Allow for tempdb files to automatically grow as required. Rule for file size increment is 2 min * the speed of IO system on which the tempdb files are located. Example: if the I/O system can initialize the database file at 50 MB/s, then auto growth increment is 50 *2 *60= 6 GB
  3. Preallocate the enough large disk space for tempdb files to accommodate the typical workload in the environment.
  4. Create a data file for each cpu, if the cpu is dual-core, consider it as 2 cpus.
  5. Make each file the same size. This allows for optimal proportional-fill performance.
  6. Put the tempdb database on disks that differ from those that are used by user databases.

Monitor the space usage:

use tempdb

go

select * from sys.dm_db_session_space_usage

select * from sys.dm_db_task_space_usage

select * from sys.dm_db_file_space_usage

http://technet.microsoft.com/en-us/library/ms345368(v=sql.105).aspx

SQL server performance - tempdb的更多相关文章

  1. SQL Server performance tips

    Refer to: http://harriyott.com/2006/01/sql-server-performance-tips A colleague of mine has been look ...

  2. SQL Server中tempdb的管理

    原文:SQL Server中tempdb的管理 资料来自: http://blogs.msdn.com/b/sqlserverstorageengine/archive/tags/tempdb/ ht ...

  3. SQL Server中TempDB管理(version store的逻辑结构)

    原文:SQL Server中TempDB管理(version store的逻辑结构) 原文来自: http://blogs.msdn.com/b/sqlserverstorageengine/arch ...

  4. SQL Server中TempDB管理(版本存储区的一个example)

    原文:SQL Server中TempDB管理(版本存储区的一个example) 原文来自: http://blogs.msdn.com/b/sqlserverstorageengine/archive ...

  5. 监测谁用了SQL Server的Tempdb空间

    原文:监测谁用了SQL Server的Tempdb空间 转自:http://blogs.msdn.com/b/apgcdsd/archive/2011/02/11/sql-server-tempdb. ...

  6. SQL Server中tempdb的management

    对<SQL Server中tempdb的management>的一些更正和补充   对<SQL Server中tempdb的management>的一些更正和补充 前几天看了这 ...

  7. [转]如何监测谁用了SQL Server的Tempdb空间

    Tempdb 系统数据库是一个全局资源,供连接到 SQL Server 实例的所有用户使用.在现在的SQL Server里,其使用频率可能会超过用户的想象.如果Tempdb空间耗尽,许多操作将不能完成 ...

  8. 对《SQL Server中tempdb的management》的一些更正和补充

    对<SQL Server中tempdb的management>的一些更正和补充 前几天看了这篇文章:SQL Server中tempdb的management 发现里面有些内容不是很准确 文 ...

  9. sql server转移tempdb数据库的物理存放位置

    转移前将原来的文件备份一下   将 tempdb 从其在磁盘上的当前位置移动到其他磁盘位置.由于每次启动 MSSQLSERVER 服务时都会重新创建 tempdb,因此不需要从物理意义上移动数据和日志 ...

随机推荐

  1. MyEclipse运行很慢的原因

    myEclipse以其丰富的功能博得程序员的热爱,但是其速度确实有问题,jsp文 件打开会不停的校验,甚至出现卡死,分析原因,原来是 validation在做怪. 好,既然找到了原因,那就把问题解决, ...

  2. linux设备驱动第五篇:驱动中的并发与竟态

    综述 在上一篇介绍了linux驱动的调试方法,这一篇介绍一下在驱动编程中会遇到的并发和竟态以及如何处理并发和竞争. 首先什么是并发与竟态呢?并发(concurrency)指的是多个执行单元同时.并行被 ...

  3. 数码管字符产生器GenSym 1.0发布

    本软件可以实现以下功能: 1.支持共阴极和共阳极数码管的字符代码的生成. 2.支持C语言和ASM语言方式产生字符串代码的序列. 3.可定制数码管的最高位和最低位的代码产生次序. 4.支持记忆功能,可以 ...

  4. 处理XML的几种方式

    晚上突然收到codeproject发来的订阅邮件,上面是关于用DOM出来XML,想总结一下有哪些方式可以轻松得处理XML DOM:这个再古老不过了,貌似大学开XML课程的时候,老师首推DOM XPat ...

  5. 删除vlan的方法

    方法一: 删除VLAN     先删接口     switch(config)#int ra f0/1 - 5     switch(config-if)#no switchport access v ...

  6. 简述负载均衡&CDN技术

    曾经见到知乎上有人问“为什么像facebook这类的网站需要上千个工程师维护?”,下面的回答多种多样,但总结起来就是:一个高性能的web系统需要从无数个角度去考虑他,大到服务器的布局,小到软件中某个文 ...

  7. mysql导出导入某张表

    一般表数据少的话都用图形界面了,看着比较方便. 如果表中数据比较多,用图形界面极容易卡死,这个时候就要用到命令行了. 用命令行导出导入大量数据还是比较快的,方法如下: 导出库db1中的表table1: ...

  8. iOS开发之runtime的运用-获取当前网络状态

    之前写过runtime的一些东西,这次通过runtime获取一些苹果官方不想让你拿到的东西,比如,状态栏内部的控件属性.本文将通过runtime带你一步步拿到状态栏中显示网络状态的控件,然后通过监测该 ...

  9. SQL Server 2008连接字符串写法大全{转}

    一..NET Framework Data Provider for SQL Server 类型:.NET Framework类库使用:System.Data.SqlClient.SqlConnect ...

  10. __dict__和__slots__

    __dict__: __slots__: