Performance tips?

Performance tips?

Postby sam2 » Tue 20 Sep 2011 00:11

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
sam2
 
Posts: 9
Joined: Thu 01 Sep 2011 18:10

Postby wgkwvl » Tue 20 Sep 2011 10:28

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;
}
wgkwvl
 
Posts: 39
Joined: Tue 20 Jul 2010 15:13

Postby sam2 » Tue 20 Sep 2011 17:01

Thanks wgkwvl - sorry to say it is no help.
sam2
 
Posts: 9
Joined: Thu 01 Sep 2011 18:10

Postby sam2 » Wed 21 Sep 2011 15:40

Any other suggestions? Things to check? This is turning out to be a pretty big problem.
sam2
 
Posts: 9
Joined: Thu 01 Sep 2011 18:10

Postby sam2 » Thu 22 Sep 2011 01:18

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
sam2
 
Posts: 9
Joined: Thu 01 Sep 2011 18:10

Postby Shalex » Thu 22 Sep 2011 11:10

Please refer to the Performance Considerations (Entity Framework) article (http://msdn.microsoft.com/en-us/library/cc853327.aspx).
Shalex
Devart Team
 
Posts: 7705
Joined: Thu 14 Aug 2008 12:44

Postby xolartek » Fri 14 Oct 2011 16:50

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.
xolartek
 
Posts: 4
Joined: Fri 14 Oct 2011 16:24


Return to dotConnect for Oracle