加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql-server – 有人可以解释DBCC DROPCLEANBUFFERS吗?

发布时间:2020-12-12 16:11:42 所属栏目:MsSql教程 来源:网络整理
导读:有人可以与CHECKPOINT运算符一起解释使用DBCC DROPCLEANBUFFERS并提供一个例子吗? 我了解在查询之前运行的性能测试非常有用,但我并没有完全掌握它.此外,我也没有关于与CHECKPOINT运算符结合使用的线索. 如果我在我的查询之前执行它们需要更长的时间才能运行,
有人可以与CHECKPOINT运算符一起解释使用DBCC DROPCLEANBUFFERS并提供一个例子吗?

我了解在查询之前运行的性能测试非常有用,但我并没有完全掌握它.此外,我也没有关于与CHECKPOINT运算符结合使用的线索.

如果我在我的查询之前执行它们需要更长的时间才能运行,所以我猜测比较性能是很好的,但不能准确地评估它们.

任何帮助将不胜感激!

解决方法

CHECKPOINT将修改的数据页面刷新到磁盘:

[CHECKPOINT] Writes all dirty pages for the current database to disk. Dirty pages are data pages that have been entered into the buffer cache and modified,but not yet written to disk. Checkpoints save time during a later recovery by creating a point at which all dirty pages are guaranteed to have been written to disk.

DBCC DROPCLEANBUFFERS然后删除任何非肮脏(肮脏,干净)页面:

Use DBCC DROPCLEANBUFFERS to test queries with a cold buffer cache without shutting down and restarting the server.

To drop clean buffers from the buffer pool,first use CHECKPOINT to produce a cold buffer cache. This forces all dirty pages for the current database to be written to disk and cleans the buffers. After you do this,you can issue DBCC DROPCLEANBUFFERS command to remove all buffers from the buffer pool.

最终的结果是你从没有缓存开始.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读