有人可以解释 DBCC DROPCLEANBUFFERS 吗? [英] Can someone explain DBCC DROPCLEANBUFFERS?

查看:50
本文介绍了有人可以解释 DBCC DROPCLEANBUFFERS 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释 DBCC DROPCLEANBUFFERSCHECKPOINT 运算符的使用并提供示例吗?

Can someone explain the use of DBCC DROPCLEANBUFFERS together with the CHECKPOINT operator and provide an example?

我知道在您的查询之前测试运行的性能很有用,但我并没有完全掌握它.我也不知道与 CHECKPOINT 运算符结合使用.

I understand it is useful to test performances running before your queries but I don't fully grasp it. Also I have no clue about the use in combination with the CHECKPOINT operator.

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

If I execute it before my queries they take much longer to run, so I am guessing it is good to compare performances but not to accurately evaluate them.

任何帮助将不胜感激!

推荐答案

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

CHECKPOINT flushes modified data pages to disk:

[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 然后删除任何非脏(低,干净)页面:

DBCC DROPCLEANBUFFERS then removes any non dirty (iow, clean) pages:

使用 DBCC DROPCLEANBUFFERS 测试具有冷缓冲区缓存的查询,而无需关闭和重新启动服务器.

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

要从缓冲池中删除干净的缓冲区,首先使用 CHECKPOINT 来生成冷缓冲区缓存.这会强制将当前数据库的所有脏页写入磁盘并清理缓冲区.执行此操作后,您可以发出 DBCC DROPCLEANBUFFERS 命令以从缓冲池中删除所有缓冲区.

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.

最终结果是您从没有缓存任何内容开始.

The end result is that you're starting with nothing cached.

这篇关于有人可以解释 DBCC DROPCLEANBUFFERS 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆