微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

有人可以与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.

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐