SQL server performance - tempdb
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:
- Set the tempdb to single recovery model. Less logs.
- 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
- Preallocate the enough large disk space for tempdb files to accommodate the typical workload in the environment.
- Create a data file for each cpu, if the cpu is dual-core, consider it as 2 cpus.
- Make each file the same size. This allows for optimal proportional-fill performance.
- 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的更多相关文章
- SQL Server performance tips
Refer to: http://harriyott.com/2006/01/sql-server-performance-tips A colleague of mine has been look ...
- SQL Server中tempdb的管理
原文:SQL Server中tempdb的管理 资料来自: http://blogs.msdn.com/b/sqlserverstorageengine/archive/tags/tempdb/ ht ...
- SQL Server中TempDB管理(version store的逻辑结构)
原文:SQL Server中TempDB管理(version store的逻辑结构) 原文来自: http://blogs.msdn.com/b/sqlserverstorageengine/arch ...
- SQL Server中TempDB管理(版本存储区的一个example)
原文:SQL Server中TempDB管理(版本存储区的一个example) 原文来自: http://blogs.msdn.com/b/sqlserverstorageengine/archive ...
- 监测谁用了SQL Server的Tempdb空间
原文:监测谁用了SQL Server的Tempdb空间 转自:http://blogs.msdn.com/b/apgcdsd/archive/2011/02/11/sql-server-tempdb. ...
- SQL Server中tempdb的management
对<SQL Server中tempdb的management>的一些更正和补充 对<SQL Server中tempdb的management>的一些更正和补充 前几天看了这 ...
- [转]如何监测谁用了SQL Server的Tempdb空间
Tempdb 系统数据库是一个全局资源,供连接到 SQL Server 实例的所有用户使用.在现在的SQL Server里,其使用频率可能会超过用户的想象.如果Tempdb空间耗尽,许多操作将不能完成 ...
- 对《SQL Server中tempdb的management》的一些更正和补充
对<SQL Server中tempdb的management>的一些更正和补充 前几天看了这篇文章:SQL Server中tempdb的management 发现里面有些内容不是很准确 文 ...
- sql server转移tempdb数据库的物理存放位置
转移前将原来的文件备份一下 将 tempdb 从其在磁盘上的当前位置移动到其他磁盘位置.由于每次启动 MSSQLSERVER 服务时都会重新创建 tempdb,因此不需要从物理意义上移动数据和日志 ...
随机推荐
- django Forgienkey字段 在前台用js做处理
在我做的项目中有个选择省城市的选项,这两个字段的关系是一对多的关系class Province(models.Model): # 省会 name = models.CharField(max ...
- 3527: [Zjoi2014]力 - BZOJ
题目大意:给出n个数qi,定义 Fj为 令 Ei=Fi/qi,求Ei. 看了很久题解,终于有些眉目,因为知道要用FFT,所以思路就很直了 其实我们就是要±1/(j-i)^2 ( j-i大 ...
- ptype_base和ptype_all学习笔记
"linux-2.6.32/include/linux/netdevice.h" struct packet_type { __be16 type; /* This is real ...
- SqlServer with递归查询的使用
1.数据准备假定有一个表DiGui,有两个字段Id int ParentId intId ParentId4 05 07 02 18 515 59 714 1130 1523 1541 18104 2 ...
- java加载机制整理
本文是根据李刚的<疯狂讲义>作的笔记,程序有的地方做了修改,特别是路径,一直在混淆,浪费了好多时间!!希望懂的同学能够指导本人,感激尽............ 1.jvm 和 类的关系 当 ...
- Vim配置文件(Vimrc)
嘛……后面的比赛基本都是在NOI Linux下进行了,windows下的开发环境基本都不能用了>_>果断转了vim,记录一下vim的配置文件- set nu syntax on filet ...
- 剑指offer--面试题21
题目:设计包含min函数的栈,pop(),push(),min()的时间复杂度均为O(1) 自己所写代码如下:(写‘栈’的代码还是有些不熟练!) #include <iostream> u ...
- [工作积累] 32bit to 64bit: array index underflow
先贴一段C++标准(ISO/IEC 14882:2003): 5.2.1 Subscripting: 1 A postfix expression followed by an expression ...
- 我的第一款windows phone软件
我的第一个windows phone应用发布成功了,大家支持下,名字叫吕氏春秋,发布人是我的英文名xmfdsh http://www.windowsphone.com/zh-cn/store/app/ ...
- PE文件结构深入详解
一.PE结构基础 看了很多PE结构类的东东,要不上来就是整体结构,要不就是一大堆ASM代码,看的我等菜鸟有点难受!所以自己写个帖·学习PE我们先来弄懂几个问题! 1:几个地址的概念 VA:虚拟地址,也 ...