3

我正在分析我的应用程序(分析 - >启动性能向导...),并且正在查看显示应用程序在数据库调用上花费多长时间的层交互视图。为什么这么多sp_procedure_params_100_managed调用?

我有一个行表示:

[myDb].[sys].[sp_procedure_params_100_managed] 

称为73倍。

发生了什么事?

+0

它会出现的参数没有被高速缓存,在此基础上[问题](http://stackoverflow.com/questions/704794/enterprise-library-caching-parameters-on-stored-procs ) – billinkc 2012-01-13 21:48:09

+0

@billinkc - 我会采取一个高峰。 – 2012-01-13 21:53:40

回答

3

这听起来像你正在使用企业框架,这听起来像EF正在的一大堆“DiscoverParameters()”呼叫:

Enterprise library caching parameters on stored procs?

这里是一个可能的解决方法(从上面的链接) :

http://davidhayden.com/blog/dave/archive/2006/11/03/CachingStoredProcedureParameters.aspx

+0

虽然我没有使用entlib,但是我会看看链接,谢谢 – 2012-01-13 21:54:41

+0

看起来我需要使用SqlCommandBuilder.DeriveParameters来执行代码; – 2012-01-13 22:00:59

+0

davidhayen.com链接已损坏。 archive.org:https://web.archive.org/web/20070210091538/http://davidhayden.com/blog/dave/archive/2006/11/03/CachingStoredProcedureParameters.aspx – hectorct 2014-05-23 11:46:41