Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
- Posts: 10
- Joined: Fri 03 Apr 2009 08:39
I´m currently testing the Entity Framework with dotConnect 188.8.131.52.
Running a simple Limit-Query against a Table, results in a Query like this:
Code: Select all
foreach(Account account in entities.Accounts.OrderBy("it.AccountId").Skip(2).Take(3))
Project1.C1 AS C1,
Project1.AccountId AS AccountId,
Project1.AccountName AS AccountName
FROM ( SELECT
Extent1.AccountId AS AccountId,
Extent1.AccountName AS AccountName,
1 AS C1
FROM Test.Account AS Extent1
) AS Project1
ORDER BY Project1.AccountId ASC
The Table is queried with a non limiting Subquery, which results in a full table scan.
Is there a way to optimize this?
- Devart Team
- Posts: 2919
- Joined: Mon 07 Jul 2008 13:16
I have just tried a simple table select and the generated SQL was the correct one.
Then I wrote DefiningQuery for this table and have obtained the query similar to the one you have posted.
There is no possibility to optimize the query if you use DefiningQuery.
If it is not the case, please send me (support * devart * com) the script of your DB object and the generated model,
we will investigate the issue.