dotConnect slow to return oracle query result

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
jeffeynon
Posts: 3
Joined: Thu 30 Jul 2015 14:55

dotConnect slow to return oracle query result

Post by jeffeynon » Mon 03 Aug 2015 18:42

I have an Linq to Entities query that runs against an Oracle 12c DB. The query is fairly simple (joins together 3 or 4 tables via an inner join, does some filtering and a sort). It returns about 30000 rows. If I run the query in oracle it returns in milliseconds. However the linq query takes 5 minutes or even longer to return via ToListAsync(). What gives? This can't be expected behavior. Is there a setting or something I might have wrong?

I should also note that this is NOT the first query run against the model in the app domain, so the model is already generated.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect slow to return oracle query result

Post by Shalex » Tue 04 Aug 2015 12:40

jeffeynon wrote:If I run the query in oracle it returns in milliseconds.
1. Are you running in Oracle exactly the same query which was generated by Entity Framework engine? You can check the generated query via the dbMonitor tool.
2. Have you tried using the pregenerated views? Entity Developer has the View Generation property of EntityContextModel.
3. General information about performance considerations with Entity Framework: https://msdn.microsoft.com/en-us/library/cc853327.aspx.

jeffeynon
Posts: 3
Joined: Thu 30 Jul 2015 14:55

Re: dotConnect slow to return oracle query result

Post by jeffeynon » Thu 06 Aug 2015 13:51

I have a statement like

var query = <my linq query>;

I hover over query to get the SQL. That SQL runs in milliseconds. I can't use view pregeneration because I'm using code first so I don't have an edmx model.

This seems to be a problem with materializing the objects from the data returned.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: dotConnect slow to return oracle query result

Post by MariiaI » Mon 10 Aug 2015 11:44

Unfortunately, the information you've provided is not enough to reproduce the issue and find the solution to avoid it.

Please create a small test project, with which this behaviour could be reproduced, and send it us with the necessary DDL/DML scripts, so that we are able to investigate it in more details, determine the reason and find the most suitable solution for you in a shortest time.

Post Reply