• ORM Open Access Demo
  • ASP.NET Ajax Demo
  • Extensions for ASP.NET MVC
  • Silverlight Demo
  • WPF Demo
  • Reporting Demo
  • Visit Telerik site
Q1 2010 (v2010.1.310, 10 March 2010) release history
Vote
+2

Fetch Plans

Enable the “Use fetch plan” option and try paging and sorting. The number of executed queries will be decreased.
15 queries executed.
1024832.387/4/1996 12:00:00 AM8/1/1996 12:00:00 AM59 rue de l'AbbayeReimsFrance7/16/1996 12:00:00 AMVins et alcools ChevalierBuchanan
1024911.617/5/1996 12:00:00 AM8/16/1996 12:00:00 AMLuisenstr. 48MünsterGermany7/10/1996 12:00:00 AMToms SpezialitätenSuyama
1025065.837/8/1996 12:00:00 AM8/5/1996 12:00:00 AMRua do Paço, 67Rio de JaneiroBrazil7/12/1996 12:00:00 AMHanari CarnesPeacock
1025141.347/8/1996 12:00:00 AM8/5/1996 12:00:00 AM2, rue du CommerceLyonFrance7/15/1996 12:00:00 AMVictuailles en stockLeverling
1025251.307/9/1996 12:00:00 AM8/6/1996 12:00:00 AMBoulevard Tirou, 255CharleroiBelgium7/11/1996 12:00:00 AMSuprêmes délicesPeacock
1025358.177/10/1996 12:00:00 AM7/24/1996 12:00:00 AMRua do Paço, 67Rio de JaneiroBrazil7/16/1996 12:00:00 AMHanari CarnesLeverling
1025422.987/11/1996 12:00:00 AM8/8/1996 12:00:00 AMHauptstr. 31BernSwitzerland7/23/1996 12:00:00 AMChop-suey ChineseBuchanan
10255148.337/12/1996 12:00:00 AM8/9/1996 12:00:00 AMStarenweg 5GenèveSwitzerland7/15/1996 12:00:00 AMRichter SupermarktDodsworth
1025613.977/15/1996 12:00:00 AM8/12/1996 12:00:00 AMRua do Mercado, 12ResendeBrazil7/17/1996 12:00:00 AMWellington ImportadoraLeverling
1025781.917/16/1996 12:00:00 AM8/13/1996 12:00:00 AMCarrera 22 con Ave. Carlos Soublette #8-35San CristóbalVenezuela7/22/1996 12:00:00 AMHILARION-AbastosPeacock
Page size:
select
 829 items in 83 pages
This example demonstrates how to use a single query to retrieve fields from different databases by using FetchPlans and FetchGroups. It retrieves all orders and fetches the CompanyName and LastName for each Customer. By default, such operation would require the execution of more queries as data would be retrieved from several tables, but by using Telerik OpenAccess ORM you can include the required related fields in a fetch group and retrieve the records in a single query.

FetchPlans
and FetchGroups provide you with a mechanism where you can specify the retrieval of only those fields that are required from the database in as few database calls as possible. Thus you could optimize the queries executed by OpenAccess ORM when retrieving more complex data. A default FetchGroup is created for each class, and it  retrieves all fields that are of basic type or a single reference type (where only the id of the referenced object is retrieved), as a result of a query or while resolving a reference.
 
Telerik OpenAccess ORM allows you to specify fetch groups in a visual way from a "Forward Mapping" dialog available in Visual Studio. You do not need to change your queries (OQL or LINQ) and put information about your fetch groups, which makes things easier for maintenance.