This is a migrated thread and some comments may be shown as answers.

Loading thousands of entities with LINQ

3 Answers 69 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Thomas
Top achievements
Rank 1
Thomas asked on 20 Jan 2010, 03:01 PM

I am trying to load a list with thousands of entities with LINQ:

var customers = scope.Extent<Customer>(); // about 80000 entries 

The problem is that each Customer object references to other tables like CustomerState and Country. Now I try to bind this list to a Grid (no Telerik Grid) which contains these joined properties.

OpenAccess seems to load each entry with it's joins. So the app comes to a complete halt.

What can I do? Could views solve the problem? Where is this documented?

3 Answers, 1 is accepted

Sort by
0
Accepted
Jan Blessenohl
Telerik team
answered on 20 Jan 2010, 07:03 PM
Hello Thomas,
Please have a look at our FetchPlans. You can specifiy what you want to load together and OpenAccess does in with minimal calls.

All the best,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Thomas
Top achievements
Rank 1
answered on 21 Jan 2010, 02:53 PM
Fetchplans improved performance very much. Yet it still takes some time to display my entries.
Is there anything else that can be done?
0
Jan Blessenohl
Telerik team
answered on 22 Jan 2010, 09:51 AM
Hello Thomas,
You should analyze how many queries are really executed to display your data. You can do that by using a tool from the database vendor or our logging mechanism. A good way is to implement your own trace listener and count the amount of query execute calls, if you display the actual value somewhere in you app you can always see if there are too many calls. You can find the example here in the product:

examples\ExamplesWin\Examples\FetchPlans\OpenAccessTracer.cs/vb

Greetings,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Development (API, general questions)
Asked by
Thomas
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or