If I have a LINQ
query like this:
query.OrderBy(e => e.Name).Where(e => e.Name.Contains("Test")).Take(10);
What would be the execution order of ORDERBY
, WHERE
and TAKE
.
- Is
ORDERBY
done only on records that match the search criteria or on the whole table? - Will it search whole table for search criteria and then do
TAKE 10 records
or it will stop search when it gets 10 records that match criteria?