Page 1 of 1

Performance tips?

Posted: Tue 20 Sep 2011 00:11
by sam2
My query takes 3 min 16 seconds to run when I run it from managed code.
When I paste the generated sql to Oracle SQL Developer it takes about 8 seconds.
Why does it take so much longer from code? How can I make it faster? I have already followed the instructions found here: http://www.devart.com/forums/viewtopic.php?t=18928
regarding precompiling the query.

The query returns about 162k rows.

I've seen a few references to a switch called ObjectTrackingEnabled however I cannot figure out how to use that. My query is read-only so if could turn off change tracking that would most likely help.

Thanks,

Sam

Posted: Tue 20 Sep 2011 10:28
by wgkwvl
suppose your object is 'Car',
then your querymethod looks like
public IQueryable Query(){
var query = _context.Cars.Where();
return query;
}

Change it to :
public IQueryable Query(){
_context.Cars.MergeOption = MergeOption.NoTracking;
var query = _context.Cars.Where();
return query;
}

Posted: Tue 20 Sep 2011 17:01
by sam2
Thanks wgkwvl - sorry to say it is no help.

Posted: Wed 21 Sep 2011 15:40
by sam2
Any other suggestions? Things to check? This is turning out to be a pretty big problem.

Posted: Thu 22 Sep 2011 01:18
by sam2
I'm still working on this.

I cannot figure out why my query is slower every time I run it.

I found this post which concerns me:

http://stackoverflow.com/questions/1781 ... a-provider

I've searched this site for any help, if you can send a link that will point me in the right direction I would definately appreciate it.

Thanks,
Sam

Posted: Thu 22 Sep 2011 11:10
by Shalex
Please refer to the Performance Considerations (Entity Framework) article (http://msdn.microsoft.com/en-us/library/cc853327.aspx).

Posted: Fri 14 Oct 2011 16:50
by xolartek
I'm encountering the same performance issue regarding dotConnect for Oracle. Running a query in Oracle SQL Developer, it only takes fractions of a second. Inside Visual Studio, in a mock test, the query takes 2.5 seconds. In a production environment, we expect to query thousands of records and the length of time it takes to query the data is unacceptable.