什么可能导致功能缓慢的导入性能? [英] What could be causing slow function import performance?
问题描述
我有一个存储过程,当我运行它自己完成执行几ms之后。但是,一旦我将存储过程导入到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?
推荐答案
我看到人们有这个问题当SQL Server有一个坏的缓存执行计划。人们似乎建议运行以下命令来修复它:
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:
DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE
请参阅从网络调用时存储过程缓慢,从Management Studio 快速获取更完整的答案。
See Stored procedure slow when called from web, fast from Management Studio for a more complete answer.
这篇关于什么可能导致功能缓慢的导入性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!