开发者

In Linq to SQL how do you prevent Compiled queries from recompiling

开发者 https://www.devze.com 2023-03-13 00:21 出处:网络
I am using compiled queries. As expected they take extra time to compile for the first time however what I have also noticed is that they recompile after not being called for approximately 30 minutes.

I am using compiled queries. As expected they take extra time to compile for the first time however what I have also noticed is that they recompile after not being called for approximately 30 minutes.

Is it possible to control when queries recompile or prevent them for recompiling altogether?

FYI: An example of the performance dif开发者_Go百科ference I notice is that one of my queries take 6 seconds when uncompiled compared to less than 10 seconds when compiled, so it's going to make a huge difference if I can control or prevent queries from recompiling.

Any help would be greatly appreciated.


if you not using compiled query and write your query using linq,then in first time your query execute on Sql Engine an execution plan will created and then sql server using that execution plan

0

精彩评论

暂无评论...
验证码 换一张
取 消