文章出處

2017-11-01 09:49:44.35 spid166     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2017-11-01 09:49:47.85 spid166     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2017-11-01 09:49:47.85 spid166     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.

數據庫ERRORLOG中出現類似記錄,因此去查找相關的文檔,發現SQL Server在做一些配置變更時會徹底清除一次執行計劃緩存,這很好的解釋了許多時候修改最大內存也會導致執行計劃變更,SQL執行性能變化的現象。具體的官方文檔為:https://support.microsoft.com/en-us/help/917828/you-may-experience-a-decrease-in-query-performance-after-you-perform-c

文檔中列出了所有可能導致此種情況出現的操作:

    • A database has the AUTO_CLOSE database option set to ON. When no user connection references or uses the database, the background task tries to close and shut down the database automatically.
    • You run several queries against a database that has default options. Then, the database is dropped.
    • A database snapshot for a source database is dropped.

      Note Database snapshots are only available in Microsoft SQL Server 2005 Enterprise Edition.
    • You change the database state to OFFLINE or ONLINE.
    • You successfully rebuild the transaction log for a database.
    • You restore a database backup.
    • You run the DBCC CHECKDB statement.

      Note This is true only in versions of SQL Server 2005 that are earlier than SQL Server 2005 SP2. After you install SQL Server 2005 SP2 or later versions, the whole procedure cache is not flushed when you run the DBCC CHECKDB statement.
    • You detach a database.
    • You specify one of the following options when you run the ALTER DATABASE statement:
      • OFFLINE
      • ONLINE
      • MODIFY FILEGROUP DEFAULT
      • MODIFY_NAME
      • MODIFY FILEGROUP READ_WRITE
      • COLLATE
      • MODIFY FILEGROUP READ_ONLY
      • READ_ONLY
      • READ_WRITE
    • The whole procedure cache is cleared if one of the following server options is changed by the RECONFIGURE statement:
      • cross db ownership chaining
      • index create memory (KB)
      • remote query timeout (s)
      • user options
      • max text repl size (B)
      • cost threshold for parallelism
      • max degree of parallelism
      • min memory per query (KB)
      • query wait (s)
      • min server memory (MB)
      • max server memory (MB)
      • query governor cost limit
      Note Procedure cache will not be cleared if the actual value does not change or if the new value for the max server memory server option is set to 0.

文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()