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. Centos6.5以下Samba服务配置

    一.简介 Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件,而SMB是Server Message Block的缩写,即为服务器消息块 ,SMB主要是作为Microsoft的 ...

  2. 【BZOJ】【3504】【CQOI2014】危桥

    网络流/最大流 比较裸的最大流= = 无向图上走来回其实就等价与走两遍>_> 如果路径有相交其实不影响答案的 比较恶心的是两个人路过同一座桥,但走的方向不同互相抵消流量了…… 其实只要在第 ...

  3. IIS8托管WCF服务

    WCF服务程序本身不能运行,需要通过其他的宿主程序进行托管才能调用WCF服务功能,常见的宿主程序有IIS,WAS,Windows服务,当然在学习WCF技术的时候一般使用控制台应用程序或WinForm程 ...

  4. depthstencil buffer 不支持 msaa

    phyreengine dx11 MRT不支持 depth rendertarget 的msaa 他里面竟然只写着,// not supported yet !!!! 导致hdao 时开msaa的话, ...

  5. RCC 2014 Warmup (Div. 2)

    一场很很多HACK的比赛,PREtest太弱了,真的很多坑!平时练习的时候很少注意这些东西了! A:开始一直在模拟,后来发现自己的思路逻辑很乱,果然做比赛不给力! 直接在代码中解释了 #include ...

  6. nodejs快速入门

    目录: 编写第一个Node.js程序: 异步式I/O和事件循环: 模块和包: 调试. 1. 编写第一个Node.js程序: Node.js 具有深厚的开源血统,它诞生于托管了许多优秀开源项目的网站—— ...

  7. Android fill_parent、wrap_content和match_parent的区别

    三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便. 1)fill_parent 设置一个构件的布局为fill_parent将强制性地使构件扩展,以 ...

  8. 提权后获取linux root密码

    提权后获取linux root密码 2011-09-09 10:45:25     我来说两句      收藏    我要投稿 在webbackdoor本身是root(可能性小的可怜)或通过某漏洞溢出 ...

  9. 时序列数据库武斗大会之 OpenTSDB 篇

    [编者按] 刘斌,OneAPM后端研发工程师,拥有10多年编程经验,参与过大型金融.通信以及Android手机操作系的开发,熟悉Linux及后台开发技术.曾参与翻译过<第一本Docker书> ...

  10. HDU 3623 Best Cow Line, Gold(模拟,注意思路,简单)

    题目 POJ 3617 和 这道题题目一样,只是范围稍稍再小一点. //模拟试试 #include<stdio.h> #include<string.h> #include&l ...