Optimize Fields on Related Entities

Posts   
 
    
gabrielk avatar
gabrielk
User
Posts: 231
Joined: 01-Feb-2005
# Posted on: 01-Nov-2007 22:54:18   

Hi,

I am trying to increase the performance of some statistics method I have written.

It's a method on OrderItems, at the moment ca. 5000 but will be growing VERY fast, and I need to read their OrderItem.ProductName to display in the reports. I am now prefetching the ProductEntity, but only for the Field "Name". How can I make the property > OrderItem.ProductName (Which maps on Product.Name, defined in the Designer of LLBL) only retrieve some kind of ProductSlimEntity which has ProductId and Name as Properties?

Any pointers and hints are more than welcome.

I found some info in: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=9765&HighLight=1 but couldn't find out how to implement it in this scenario for Designer defined properties.

Since the app will be running at a provider Memory AND Cpu are an issue, cpu for response time and Mem for a limit at the provider.

Thanks, Gab

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Nov-2007 10:42:02   

If you are using v.2.5 you make use of the new feature of Execluding fields from being fetched.

There are some overloads of the PrefetchPath.Add() method that accepts a ExcludeIncludeFieldsList. So you may use it to execlude all the fields that you don't want to fetch from the ProductEntity, when prefetching it.

Otherwise, if you are using an older version, then you might map the product table into another Entity (SlimProduct simple_smile ), and only include the ID & Name.