title: Compiling a predicate retrieves the whole table before getting the count
body: <p>This executes as <code>.Count()</code> on the SQL side:</p>
  
  <pre><code>account.SelectMany(acc =&gt; acc.Transactions).Count(t =&gt; !t.Disabled)
  </code></pre>
  
  <p>and this retrieves the whole table before getting me the count:</p>
  
  <pre><code>private Expression&lt;Func&lt;Transaction, bool&gt;&gt; transactionsFilterPredicate = t =&gt; !t.Disabled;
  account.SelectMany(acc =&gt; acc.Transactions).Count(this.transactionsFilterPredicate.Compile())
  </code></pre>
  
  <p>Why? I want to be able to extract the predicate as a variable. Is there a way to do it, and still benefit from the SQL-side operation?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Apparently removing the <code>.Compile()</code> part of the code solves the issue... The code still compiles (as in <code>MSBuild</code>) and the Count is on the SQL side. What is the benefit of <code>.Compile()</code>?</p>