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. TCL随记(2)

    file函数: file dirname name 返回文件所在目录 file exists name 测试文件是否存在,存在返回1,否则返回0 file extension name 返回文件扩展名 ...

  2. 《编写高质量代码:改善Java程序的151个建议》笔记

    To fight the unthinkable,you have to be willing to do the unthinkable.   不要在循环中使用try catch,应该放在循环的外面 ...

  3. pm2 开机自动运行

    pm2 start app.js -i max -name 可以运行的用户 env PATH=$PATH:/usr/bin pm2 startup -u 可以运行的用户 ubuntu/centos

  4. 手机开发Android模拟器genymotion

    手机开发的时候总会碰到一个问题,eclipse插件自带的android模拟器太慢了. 根据网络上有人推荐使用genymotion模拟器.   主要的操作步骤如下: 1.在genymotion网站注册账 ...

  5. bzoj 1015 并查集

    逆向思维,先将整张图以最后所有要求的点毁掉的状态建图,然后倒着 加点就行了,用并查集维护连通块 /*************************************************** ...

  6. apple开发者账号申请

    1.  登陆appleID. 2. 进入 Your Account 3. 在Account Summary 中的MemberShips中选择第一个(界面大概如下) 4.选择后进入下图. 5. yes ...

  7. javascript 字符串和json的互转

    FROM:http://www.cnblogs.com/mizzle/archive/2012/02/10/2345891.html 在数据传输过程中,json是以文本,即字符串的形式传递的,而JS操 ...

  8. VSS

    A deleted file of the same name already exists in this VSS project. Do you want to recover the delet ...

  9. 【一】php 操作符

    1.php单引号和双引号的区别 单引号和双引号都能表示字符串,但是单引号不能识别里面带有转义字符'/'和变量的字符串,所以需要""去表示这种字符串.或者使用<<< ...

  10. tomcat 常见错误

    1.启动时加载会话错误 Exception loading sessions from persistent storage 处理方法:删除tomcat对应的项目目录下 work/session.se ...