0

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 difference 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.

  • Are you talking about precompiling on the linq side... for example using syntax such as: System.Data.Linq.CompiledQuery.Compile or are you talking about the SQL Engine compiling the query? A code sample might be helpful in answering your question. – RThomas Jun 14 '11 at 06:33
  • Could you post a code example of exactly what you're doing please? – The Evil Greebo Jun 14 '11 at 20:27

1 Answers1

0

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

Arian
  • 12,793
  • 66
  • 176
  • 300