I am using EF5
with the MoreLinq
extenstion, while testing my program in production (very big database), I found out that the line:
var x = db.TheBigTable.MaxBy(x => x.RecordTime);
Takes very long time (RecordTime
is a non-indexed datetime
)
Is that because MaxBy
always runs on the client side (and firstly gets ALL records from the database)?