Apologies for what may very well be a stupid question.
I'm just intrigued as to (a) will indexing improve performance (b) how will it improve performance and (c) why will it improve performance?
Also, if this does improve performance, would this be the case across the board for LINQ to SQL, LINQ to Entities, LINQ to Objects, etc, etc.
Again, if this is a really stupid question, I do apologise.
It will improve the performance if, and only if, your LINQ query causes an SQL statement to be executed which can make use of the index - since, when using Linq-To-Sql, your LINQ query is translated to an SQL statement (hence the name).
For example, the following query would obviously benefit from an index on the LastName column of the Customers table.
var results = from c in db.Customers
where c.LastName == 'Smith'
select c;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With