Linq to SQL: select optimization

后端 未结 6 1063
梦如初夏
梦如初夏 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 12:01

    Additionally to what the others have said, the new unnamed structure will be a much lighter-weight object than the Person object -- it would be much faster, even if you selected all the columns. (Person has method/fields etc to support writing the object back to the database. The unnamed type does not.)

提交回复
热议问题