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.

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

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...