Why does the Contains() operator degrade Entity Framework’s performance so dramatically?
UPDATE: With the addition of InExpression in EF6, the performance of processing Enumerable.Contains improved dramatically. The approach described in this answer is no longer necessary. You are right that most of the time is spent processing the translation of the query. EF’s provider model doesn’t currently include an expression that represents an IN clause, therefore … Read more