博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SQL Server中 缓冲和池的不同点
阅读量:4497 次
发布时间:2019-06-08

本文共 2004 字,大约阅读时间需要 6 分钟。

在SQL Server中存储方式主要分为2大类 缓冲和池。都是用来临时存放数据的,到底有什么不同。一直很恼人。

有幸看到一位大牛的博客,截取了其中讲述cache 和 pool的不同点。

Before we jump into further description of stores I would like to explain a difference between meanings of caches and pools. In SQLOS's world, cache is a mechanism to cache heterogeneous type of data with a given cost for each entry. Usually there is a given state associated with an entry. A cache implements lifetime control of an entry, its visibility, and provide some type of LRU policies. Depending on the type of the data cached each entry could be used by multiple clients at the same time. For example SQL Server procedure cache is a  cache in SQLOS' s terms. A plan's lifetime, visibility and cost is controlled by SQLOS's cache mechanism. Each plan can be used by multiple batches at the same time.

 

Cache 可以存放不同的数据类型的数据,并且备份存储实体都有一个花费值(cost)。 和状态值,可见度,还有一个生命周期,使用一些LRU算法来维护。每个实体都可以在同时被多个客户端访问。如SQL Server 存储Cache 是基于cache的,一个计划的生命周期,花费(cost)都是又SQLOS 的cache机制控制的。每个计划都可以被多个批处理(batches)同时访问。

 

In its turn, pool, in SQLOS's terms, is a mechanism for caching homogeneous data. In most cases cached data doesn't have neither state nor cost associated with it. A pool has limited control over lifetime of the entry and its visibility.  Once an entry is taken from the pool it is actually removed from it and pool no longer has any control over the entry until the entry is pushed back to the pool. Only one client can use an entry at the time. An example of a pool is a pool of network buffers: no state, no cost , all  buffers of the same size. Keep in mind SQL Server's Buffer Pool is a cache in SQLOS terms. Currently it doesn't use any of SQLOS's caching mechanism

 

Pool 用来存放相同的数据类型。在多数情况下存储的数据没有状态和花费(cost)。Pool可以控制存储实体的生命周期和可见度。一旦存储实体被读取,就从pool上面被删除了,除非再存入。pool中的实体同一时间只能又一个用户使用。如:network buffers是一个pool,没有状态,没有花费,所有的buffers大小都是相同的。在SQL Server中有一个 buffer pool,它是cache。但是却没有使用SQLOS的cache机制。

posted on
2011-12-09 13:20 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/Amaranthus/archive/2011/12/09/2281870.html

你可能感兴趣的文章
Mysql安装后的一些设置
查看>>
4、Qt Project之串口数据传输
查看>>
Python List reverse()方法
查看>>
Jmeter 正则提取器
查看>>
lua -- 生成协议
查看>>
HLP帮助文件源文件RTF文件的编写
查看>>
2.30模型字符串拷贝
查看>>
XPATH怎么获取TITLE中有中文的标签
查看>>
Tomcat中server.xml参数说明
查看>>
Wget下载终极用法和15个详细的例子
查看>>
JavaScript16进制颜色值和rgb的转换
查看>>
Laravel 输出Hellow World!
查看>>
【bzoj 十连测】[noip2016十连测第九场]Problem B: 小P的单调区间(最长上升子序列+树状数组)...
查看>>
linux--samba
查看>>
django基础之中介模型
查看>>
关于副本机制
查看>>
Oracle之存储过程
查看>>
解决电脑复选框图标不正确方法
查看>>
伪数组怎么转为真正的数组呢~
查看>>
WebGL笔记(六):简单灯光
查看>>