MS SQL Server 2008 是否缓存二进制数据字段?即VARBINARY

发布于 2024-10-21 06:37:41 字数 247 浏览 2 评论 0原文

MS SQL Server 2008 是否缓存二进制数据字段?即 VARBINARY

我们有 MS SQL Server 2008 R2,使用 12GB 的 RAM 不断缓存数据。我们的数据库包含超过 200GB 的 VARBINARY。这也会被缓存吗?

编辑: SQL Server 确实缓存二进制数据谢谢@Martin

你能告诉 SQL Server 停止缓存二进制数据或以某种方式限制它吗?

Does MS SQL Server 2008 cache binary data fields? Ie VARBINARY

We have MS SQL Server 2008 R2 using 12gb of ram constantly caching data. Our database includes over 200gb of VARBINARY. Would this be cached as well?

EDIT: SQL Server does indeed cache binary data Thanks @Martin

Can you tell SQL Server to stop caching binary data or to limit this somehow?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

顾北清歌寒 2024-10-28 06:37:41

是的。尝试

WITH T
     AS (SELECT database_id,
                page_type,
                total_page_count = COUNT(*) OVER (),
                page_count = COUNT(*) OVER 
                                     (PARTITION BY database_id, page_type),
                row_num = ROW_NUMBER() OVER 
                                     (PARTITION BY database_id, page_type 
                                          ORDER BY (SELECT 0))
         FROM   sys.dm_os_buffer_descriptors)
SELECT page_type,
       page_count,
       PercentageOfCache = ROUND(1E2 * page_count / total_page_count, 2),
       SizeInCache =
       CASE
         WHEN page_count > 131072 
              THEN LTRIM(STR(page_count / 131072.0) + ' GB')
         WHEN page_count > 128 
              THEN LTRIM(STR(page_count / 128.0) + ' MB')
         ELSE LTRIM(STR(page_count * 8) + ' KB')
       END
FROM   T
WHERE  database_id = DB_ID()
       AND row_num = 1
ORDER  BY page_count DESC  

查看数据库的缓冲区高速缓存中当前有多少每种类型的页面。

专用 LOB 页类型为 TEXT_MIX_PAGETEXT_TREE_PAGE,但 LOB 数据也可以存储在数据页上。

Yes. Try

WITH T
     AS (SELECT database_id,
                page_type,
                total_page_count = COUNT(*) OVER (),
                page_count = COUNT(*) OVER 
                                     (PARTITION BY database_id, page_type),
                row_num = ROW_NUMBER() OVER 
                                     (PARTITION BY database_id, page_type 
                                          ORDER BY (SELECT 0))
         FROM   sys.dm_os_buffer_descriptors)
SELECT page_type,
       page_count,
       PercentageOfCache = ROUND(1E2 * page_count / total_page_count, 2),
       SizeInCache =
       CASE
         WHEN page_count > 131072 
              THEN LTRIM(STR(page_count / 131072.0) + ' GB')
         WHEN page_count > 128 
              THEN LTRIM(STR(page_count / 128.0) + ' MB')
         ELSE LTRIM(STR(page_count * 8) + ' KB')
       END
FROM   T
WHERE  database_id = DB_ID()
       AND row_num = 1
ORDER  BY page_count DESC  

To see how many of each type of page are currently in the buffer cache for your database.

Dedicated LOB page types are TEXT_MIX_PAGE and TEXT_TREE_PAGE but LOB data can also be stored on data pages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文