title: Function evaluation timed out error in Linq to Entity
body: <p>I'm using framework 3.5. I have one group Linq syntax like below</p>
  
  <pre><code> var TmpClause = (from c in MES_WO_Tracking
                           join s in WorkOrders
                           on c.WoNo equals s.OrderNum
                           where s.Plant == "XX" &amp;&amp; c.Shift != null
                           group new { 
                               c.QtyComplete,
                               c.QtyScrap
                           }
                           by new
                           {
                               MRP = s.MRP_CTLR,
                               SeqNo = c.SeqNo,
                               TriggerSAP = c.TriggerSAP,
                               Shift = c.Shift
                           } into n
                           select new BkdKPIOutput
                           {
                               MRP = n.Key.MRP,
                               SeqNo = n.Key.SeqNo + n.Key.TriggerSAP,
                               Shift = n.Key.Shift,
                               OutputQty = n.Sum(c =&gt; c.QtyComplete.Value),
                               InputQty = n.Sum(c =&gt; c.QtyScrap.Value) + n.Sum(c =&gt; c.QtyComplete.Value)
                           });
  </code></pre>
  
  <p>It always give me the "Function evaluation timed out" error. But strange thing is that I check the native sql, it only spend 1 sec. </p>
  
  <pre><code>SELECT  [t2].[MRP_CTLR] AS [MRP] ,
      [t2].[SeqNo] + [t2].[TriggerSAP] AS [SeqNo] ,
      [t2].[Shift] ,
      [t2].[value] AS [OutputQty] ,
      [t2].[value2] + [t2].[value3] AS [InputQty] FROM    ( SELECT    SUM([t0].[QtyComplete]) AS [value] ,
                  SUM([t0].[QtyScrap]) AS [value2] ,
                  SUM([t0].[QtyComplete]) AS [value3] ,
                  [t1].[MRP_CTLR] ,
                  [t0].[SeqNo] ,
                  [t0].[TriggerSAP] ,
                  [t0].[Shift]
        FROM      [MES_WO_Tracking] AS [t0]
                  INNER JOIN [WorkOrder] AS [t1] ON [t0].[WoNo] = [t1].[OrderNum]
        WHERE     ( [t1].[Plant] = 'XX' )
                  AND ( [t0].[Shift] IS NOT NULL )
        GROUP BY  [t1].[MRP_CTLR] ,
                  [t0].[SeqNo] ,
                  [t0].[TriggerSAP] ,
                  [t0].[Shift]
      ) AS [t2]
  </code></pre>
  
  <p>Does anyone know this? Very appreciate for your help.</p>