title: Using a Substring in LINQ causes query to time out?
body: <p>I'm trying to convert over an Oracle SQL statement to EF/LINQ that uses a substring. When using the substring it causes my query execution to go from 11 seconds to timing out with over 5 min of run time. </p>
  
  <p>In my situation I have a 4 character value and I need to only include in the results where the first and third character equal "E". Am I doing this incorrectly?</p>
  
  <p>Here is the Oracle SQL that I'm converting.</p>
  
  <pre><code>and (substr(c.operates,1,1) = 'E' or substr(c.operates,3,1) = 'E') 
  </code></pre>
  
  <p>Here is my Linq statement.</p>
  
  <pre><code>&amp;&amp; (c.OPERATES.Substring(0, 1) == "E" || c.OPERATES.Substring(2,1) == "E")
  </code></pre>
  
  <p>Even with just checking one character position this will make the query go from 11 seconds to over 5 min. </p>