什么可能导致函数导入性能缓慢?
我有一个存储过程,当我单独运行它时,它会在几毫秒后完成执行。但是,一旦我将存储过程导入 EF 并使用相同的参数调用它,大约需要 5 分钟才能完成。我是否需要调整某种设置,或者是什么导致了这种缓慢?
I have a stored procedure that finishes execution after a few ms when I run it by itself. However, once I import the stored procedure into EF and call it with the same exact parameters, it takes like 5 minutes to finish. Is there some kind of setting I need to tweak or what is causing this slowness?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我见过有人在 SQL Server 的缓存执行计划错误时遇到此问题。人们似乎建议运行以下命令来修复它:
请参阅 从 Web 调用时存储过程速度较慢,从 Management Studio 调用时速度较快以获得更完整的答案。
I've seen people have this issue when SQL Server has a bad cached execution plan. People seem to recommend running the following commands to fix it:
See Stored procedure slow when called from web, fast from Management Studio for a more complete answer.