随笔 - 74  文章 - 0  评论 - 94  阅读 - 12万

更改并行度会清空执行计划缓存

早上下面报告报表数据库反应很慢,远程桌面发现大查询过后,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优化的问题了。
posted on   万剑齐发  阅读(444)  评论(2编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示