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.
dotConnect slow to return oracle query result
Re: dotConnect slow to return oracle query result
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.jeffeynon wrote:If I run the query in oracle it returns in milliseconds.
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.
Re: dotConnect slow to return oracle query result
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.
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.
Re: dotConnect slow to return oracle query result
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.
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.