Tempdb--TempDB Basic

1. TempDB只能运行在Simple Recovery Model下

2. 由于TempDB不需要Recovery,因此在TempDB中发生的操作不需要REDO,因此在日志记录上有别于其他数据库。

3. 不是所有在Tempdb中的object都被记录日志。

4. Improved cahcing for tempory objects, SQL Server chaches 1 IAM Page and 1 data page with the associated query plan.First, if the same plan is exected multiple times, the tmeporary table needs to be created once there by reducing ddl contention and reduceing allocation contention.(如果存储过程中包含创建临时表,那么临时表只会在存储过程编译的时候被创建),Temp objects are only cached when none of the following conditions is violated:

1. Data definition languaged(DDL) statements that affects the table are not run after the temp table has been created, such as create index or create statistics statements.

2. named constraints are not created.

3. Temp objects is not created by using dynamic SQL, such as:sp_executesql

系统对一些临时对象进行优化以减少重复创建和删除临时对象造成的Allocation Bottleneck

 

 

 

Internal object: created internally by sql server to execute user command, like the temprory result set(worktable) which created by hash join.

The operation on internal objects are not logged because internal objects are created/destoryed in the scope of a single statement.

内部对象有系统创建和清理,对内部对象的操作不记录入日志。


 

posted on   笑东风  阅读(308)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现

导航

点击右上角即可分享
微信分享提示