Entity Framework Query Optimization

I have had experience with the Entity Framework for a couple of months, and basically I wrote a ton of LINQ queries to find the data. I come from a heavy sql background and try to optimize some of sql for performance and readability if I try to debug performance issues.

I notice that some of the generated sql do such things for table A with columns {col1, col2, col3}

select
    Extent1.col1
from
(
   select col1, col2, col3 from tableA
) AS Extent1

My question is how can I stop him from making these useless views and instead just do

select col1 from tableA 

where is it necessary? I can’t understand why he sometimes does this and sometimes not ...

+5
source share
1 answer

, ? , , . SQL Server, , , , , .

, ; , , , .

EDIT: , N + 1, , (, ) - . SQL Server.

+4

All Articles