title: Query execution time in Entity Framework vs in SQL Server
body: <p>I have a query written in Linq To Entities:</p>
  
  <pre><code>db.Table&lt;Operation&gt;()
      .Where(x =&gt; x.Date &gt;= dateStart)
      .Where(x =&gt; x.Date &lt; dateEnd)
      .GroupBy(x =&gt; new
      {
          x.EntityId,
          x.EntityName,
          x.EntityToken
      })
      .Select(x =&gt; new EntityBrief
      {
          EntityId = x.Key.EntityId,
          EntityName = x.Key.EntityName,
          EntityToken = x.Key.EntityToken,
          Quantity = x.Count()
      })
      .OrderByDescending(x =&gt; x.Quantity)
      .Take(5)
      .ToList();
  </code></pre>
  
  <p>The problem is that it takes 4 seconds when executing in the application using EF. But when I take the created pure SQL Query from that query object (using Log) and fire it directly on SQL Server, then it takes 0 seconds. Is it a known problem?</p>