<small id='4gzty'></small><noframes id='4gzty'>

        <bdo id='4gzty'></bdo><ul id='4gzty'></ul>
      <i id='4gzty'><tr id='4gzty'><dt id='4gzty'><q id='4gzty'><span id='4gzty'><b id='4gzty'><form id='4gzty'><ins id='4gzty'></ins><ul id='4gzty'></ul><sub id='4gzty'></sub></form><legend id='4gzty'></legend><bdo id='4gzty'><pre id='4gzty'><center id='4gzty'></center></pre></bdo></b><th id='4gzty'></th></span></q></dt></tr></i><div id='4gzty'><tfoot id='4gzty'></tfoot><dl id='4gzty'><fieldset id='4gzty'></fieldset></dl></div>
      <tfoot id='4gzty'></tfoot>

      <legend id='4gzty'><style id='4gzty'><dir id='4gzty'><q id='4gzty'></q></dir></style></legend>

      如何清除 SQL Server 查询缓存?

      How can I clear the SQL Server query cache?(如何清除 SQL Server 查询缓存?)
        <legend id='P0dvm'><style id='P0dvm'><dir id='P0dvm'><q id='P0dvm'></q></dir></style></legend>

          <small id='P0dvm'></small><noframes id='P0dvm'>

            <tbody id='P0dvm'></tbody>
          • <bdo id='P0dvm'></bdo><ul id='P0dvm'></ul>

                <tfoot id='P0dvm'></tfoot>
                <i id='P0dvm'><tr id='P0dvm'><dt id='P0dvm'><q id='P0dvm'><span id='P0dvm'><b id='P0dvm'><form id='P0dvm'><ins id='P0dvm'></ins><ul id='P0dvm'></ul><sub id='P0dvm'></sub></form><legend id='P0dvm'></legend><bdo id='P0dvm'><pre id='P0dvm'><center id='P0dvm'></center></pre></bdo></b><th id='P0dvm'></th></span></q></dt></tr></i><div id='P0dvm'><tfoot id='P0dvm'></tfoot><dl id='P0dvm'><fieldset id='P0dvm'></fieldset></dl></div>
                本文介绍了如何清除 SQL Server 查询缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个针对 SQL Server 2005 运行的简单查询

                I've got a simple query running against SQL Server 2005

                SELECT * 
                FROM Table 
                WHERE Col = 'someval'
                

                第一次执行查询可以取>15 秒.后续执行返回 <1 秒.

                The first time I execute the query can take > 15 secs. Subsequent executes are back in < 1 sec.

                如何让 SQL Server 2005 不使用任何缓存结果?我试过跑步

                How can I get SQL Server 2005 not to use any cached results? I've tried running

                DBCC DROPCLEANBUFFERS
                DBCC FREEPROCCACHE
                

                但这似乎对查询速度没有影响(仍然是<1 sec).

                But this seems to have no effect on the query speed (still < 1 sec).

                推荐答案

                这里有一些很好的解释.看看吧.

                Here is some good explaination. check out it.

                http://www.mssqltips.com/tip.asp?tip=1360

                CHECKPOINT; 
                GO 
                DBCC DROPCLEANBUFFERS; 
                GO
                

                来自链接的文章:

                如果所有性能测试都在 SQL Server 中进行,最好的方法可能是发出 CHECKPOINT,然后发出 DBCC DROPCLEANBUFFERS 命令.尽管 CHECKPOINT 进程是 SQL Server 中的一个自动内部系统进程并且定期发生,但发出此命令以将当前数据库的所有脏页写入磁盘并清理缓冲区非常重要.然后可以执行 DBCC DROPCLEANBUFFERS 命令从缓冲池中删除所有缓冲区.

                If all of the performance testing is conducted in SQL Server the best approach may be to issue a CHECKPOINT and then issue the DBCC DROPCLEANBUFFERS command. Although the CHECKPOINT process is an automatic internal system process in SQL Server and occurs on a regular basis, it is important to issue this command to write all of the dirty pages for the current database to disk and clean the buffers. Then the DBCC DROPCLEANBUFFERS command can be executed to remove all buffers from the buffer pool.

                这篇关于如何清除 SQL Server 查询缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                SQL query to group by day(按天分组的 SQL 查询)
                What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                sql group by versus distinct(sql group by 与不同)
                How to return a incremental group number per group in SQL(如何在SQL中返回每个组的增量组号)
                Count number of records returned by group by(统计分组返回的记录数)

                    <tbody id='8j6ds'></tbody>
                  <legend id='8j6ds'><style id='8j6ds'><dir id='8j6ds'><q id='8j6ds'></q></dir></style></legend>
                    <bdo id='8j6ds'></bdo><ul id='8j6ds'></ul>

                    1. <small id='8j6ds'></small><noframes id='8j6ds'>

                      <tfoot id='8j6ds'></tfoot>
                          <i id='8j6ds'><tr id='8j6ds'><dt id='8j6ds'><q id='8j6ds'><span id='8j6ds'><b id='8j6ds'><form id='8j6ds'><ins id='8j6ds'></ins><ul id='8j6ds'></ul><sub id='8j6ds'></sub></form><legend id='8j6ds'></legend><bdo id='8j6ds'><pre id='8j6ds'><center id='8j6ds'></center></pre></bdo></b><th id='8j6ds'></th></span></q></dt></tr></i><div id='8j6ds'><tfoot id='8j6ds'></tfoot><dl id='8j6ds'><fieldset id='8j6ds'></fieldset></dl></div>