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

早上下面报告报表数据库反应很慢,远程桌面发现大查询过后,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优化的问题了。

转载于:https://www.cnblogs.com/ajiangg/p/3644735.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值