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)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…