Linq to SQL: select optimization

后端 未结 6 1004
梦如初夏
梦如初夏 2021-01-18 11:16

On large tables in MSSQL; selecting specific columns results in greater speed of the query. Does the same apply to Linq to SQL?

Would this:

var perso         


        
6条回答
  •  借酒劲吻你
    2021-01-18 11:55

    I highly recommend LinqPad. It is free and lets you run LINQ queries dynamically. When you can also look at the SQL that is generated.

    What you will see is that the LINQ query will translate the first query into selecting only those columns. So it is faster.

提交回复
热议问题