更改并行度會清空執行計劃緩存早上下面報告報表數據庫反應很慢,遠程桌面發現大查詢過后,cpu不怎么動,于是我試著把并行度從0改成了32,恢復正常。按道理根據我的服務器配置并行度為0跟32是一樣的效果,為什么會恢復正常呢?以下是群里繼偉大神給的答案:從0改成32后你的執行計劃緩存會被清空,從而重新生成執行計劃.你不能動是應該發生了參數嗅探致使低效,從0變成32也好,變成1也好都會有一定效果.但過段時間問題有可能又會出現.從錯誤日志里我也找到了答案:xp_readerrorlog:Configuration option 'max degree of parallelism' changed from 0 to 32. Run the RECONFIGURE statement to install.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.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.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.接下去就是SQL優化的問題了。