In Linq to SQL how do you prevent Compiled queries from recompiling
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
精彩评论