Linq to Sql: Where condition order impact
-
21-08-2019 - |
Question
With a LINQ-TO-SQL linq query - does the SQL generated respect the 'Where conditions' order?
For instance:
int[] result = (from r in DB.Accounts
where r.AccountID > 10 && r.Name == "Harry").ToArray();
If there are thousands of rows, and there is an Index on the Name column, will the SQL query by the Indexed column first?
Solution
It doesn't matter - SQL Server will handle that.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow