Does Take(N) executes after getting full list or the execution stope after picking the needed top n records
Thanks..
Does Take(N) executes after getting full list or the execution stope after picking the needed top n records
Thanks..
this
.Where(t +> t.Something == 1)
.Take(5)
Will take the first 5 elements satisfying condition. It will NOT return the whole data set.
Take runs after the deferred execution.
Kindness,
Dan
Take(n) will translate into a Top on older versions of SQL server and ROW_NUMBER on newer versions on the SQL side, if that is what you are asking.
According to Scott Guthrie LINQ2SQL uses the ROW_NUMBER
function in SQL Server to implement the Take(n)
method. So it's done by the database and not by the client on the full result set.