How can I keep Entity Framework from generating inefficient queries in SQL Server?

后端 未结 2 1976
天命终不由人
天命终不由人 2021-01-19 05:00

I have an entity defined in an EF 4.0 that is based on a view. The view lays over a table with about 18 million rows of data. I have selected the 4 deterministic properties

2条回答
  •  时光取名叫无心
    2021-01-19 05:12

    Row limits don't make any sense without specifying an order.

    If you want to retrieve records in storage order, create a clustered index and explicitly specify it in your query.

    One way to do this is with a query interceptor.

提交回复
热议问题