title: Recompile Query-Hint on a System.Data.Linq.DataContext object
body: <p>I have a query that is being called by a DataContext object that is creating an extremely inefficient execution plan. I would like to add an "OPTION(RECOMPILE)" query hint to the query, but I do not know how to add this query hint to a DataContext object's query.</p>
  
  <p>I ran a SQL trace in order to capture the query. I ran it manually as is and it took almost four minutes, by adding "OPTION(RECOMPILE)" to the query it reduced the run time to a second. The query contains many variables, a couple table-value functions and a view with an embedded table-value function. All the input variables are numbers. The query plans between the two executions were very different.</p>
  
  <p>I do not need help optimizing the code to avoid the poor execution plan; I can do this myself if I need to go this route. All I need to know is if there is a way to add the OPTION(RECOMPILE) query hint to my Linq query. I'm not going to post the code, it is irrelevant to my question. </p>
  
  <p>If it's possible to add the Recompile Query-Hint please let me know how and if it is not possible if you could please provide a link to some documentation that indicates this to be the case I would appreciate it.</p>
  
  <p>I'm using SQL Server 2012 as my rdbms.</p>