title: Entity Framework Defining Query + IsNull + Left Join = Way Too Slow
body: <p>I have this SQL statement</p>
  
  <pre><code>select st.Column1, isnull(sot.SomeColumn, 0) as SomeColumn 
  from SomeTable st 
  left join SomeOtherTable sot 
  </code></pre>
  
  <p>inside a <code>&lt;DefiningQuery&gt;</code> tag inside my Entity Framework (4.0) .edmx file and I'm running into a serious performance issue. Running the SQL as it's written is fast, but EF wraps the SQL during runtime to inject parameters, which slows it down tremendously. </p>
  
  <p>I can take away the isnull, and it's just as fast in the wrapped EF SQL as it is natively, but I need the isnull to ensure <code>SomeColumn</code> has a value.</p>
  
  <p>Are there any alternatives to isnull that I could use here that would play nicely with EF?</p>
  
  <p>Thanks for your help.</p>