When you query for an object with Telerik OpenAccess ORM you actually retrieve only the object you requested. The related objects are not automatically fetched at the same time. With the FetchStrategy class you can specify which related objects to be load with the requested one from the database.
In your scenario the difference between the queries is that when you don’t use a fetch strategy, Open Access ORM will execute the query for the customers, but for the orders, the ORM will execute a different query for each needed order. With the fetch strategy you specify that when you want the customers, you also want to load the orders with them.
For more information about Open Access ORM Fetch Plans API, you can refer to this article.
To see how much time it takes for your queries to execute, you can use the OpenAccess Profiler and Tuning Advisor. It will help you to view detailed information about all the OpenAccess ORM activities in your application.
To use our Profiler, first you need to configure the project you want to analyze. The configuration depends on the type of the project and the type of monitoring you want to use.
1) In case you are using the Visual Designer, with a generated OpenAccessContext:
- For online monitoring you can see this video or refer to this article
- For offline monitoring you can watch this video or read more details here
2) If your project is based on a Code Only (Fluent) Model you can follow the instructions in this article
More information about the Profiler and Tuning Advisor you can find here.
Do not hesitate to get back to us if you need additional directions.
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.