A 5sec SP hitting a 30sec timeout through LINQ-to-SQL?

SQL Server optimizes stored procedures the same way whether you call them from SSMS or from LINQ. But it does use plan caching. A plan is stored for later reuse with the same login + ansi settings.

The first values passed in can determine how the plan looks. If a different login/settings starts with different values, that can result in a different cached plan. That's one explanation for performance differences between LINQ and SSMS To reset all cached plans, use: DBCC FREEPROCCACHE In order to have the SP optimized for exactly the values you're calling with, you could use with recompile : create procedure dbo.

MySP with recompile as This causes the procedure to be compiled for every invocation. This would negate parameterization (Your situation is rather unusual. SQL Server has an option to force parameterization but there's no option to prevent it.).

SQL Server optimizes stored procedures the same way whether you call them from SSMS or from LINQ. But it does use plan caching. A plan is stored for later reuse with the same login + ansi settings.

The first values passed in can determine how the plan looks. If a different login/settings starts with different values, that can result in a different cached plan. That's one explanation for performance differences between LINQ and SSMS.To reset all cached plans, use: DBCC FREEPROCCACHE In order to have the SP optimized for exactly the values you're calling with, you could use with recompile: create procedure dbo.

MySP with recompile as ... This causes the procedure to be compiled for every invocation. This would negate parameterization.(Your situation is rather unusual. SQL Server has an option to force parameterization, but there's no option to prevent it.

).

SQL Server optimizes stored procedures the same way whether you call them from SSMS or from LINQ. But it does use plan caching. A plan is stored for later reuse with the same login + ansi settings.

The first values passed in can determine how the plan looks. If a different login/settings starts with different values, that can result in a different cached plan. That's one explanation for performance differences between LINQ and SSMS.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions