title: How to Improve Linq query perfomance regarding Trim()
body: <p>Our company tables were created with fields with padded spaces.</p>
  
  <p>I don't have access/permissions to make changes to the DB.</p>
  
  <p>However, I noticed that when I create LINQ queries using the Trim() function, the performance decreases quite a bit.</p>
  
  <p>A query as simple as this shows that performance decrease:</p>
  
  <pre><code>Companies
  .Where(c =&gt; c.CompanyName.Equals("Apple"))
  .Select(c =&gt; new {
    Tick = c.Ticker.Trim(),
    Address = c.Address.Trim()
  });
  </code></pre>
  
  <p>Is there a way to change the query so that there is no loss in performance?</p>
  
  <p>Or does this rest solely with my DBA?</p>