JOINs instead of sep queries for prefetchPaths?

Posts   
 
    
wordracr
User
Posts: 12
Joined: 16-Sep-2009
# Posted on: 12-Oct-2009 18:51:24   

Is there a way to force this? When comparing retrieval times with a stored procedure that does the joins within itself, LLBL is 3x slower. I don't know if I can convince anyone to use LLBLGen if there's that much difference, so that's why I ask for the join route.. ie: customer > stateLU and countryLU tables. I need to pull from all those 3.

I'm almost wondering if someone is going to recommend making a view on the db side of things, but in my mind, that's work that the ORM should be handling itself with joins. Hopefully I can get some different perspectives from you guys simple_smile

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Oct-2009 04:36:36   

Hi wordracr,

There is no way to use join in prefetchPaths. Here is an explanation: http://llblgen.com/tinyforum/Messages.aspx?ThreadID=12912&StartAtMessage=0&#71747

If you really experiment a huge hit, you could use fetch DynamicList or even StoredProcedure and then use projections to fill an entity collection.

David Elizondo | LLBLGen Support Team
wordracr
User
Posts: 12
Joined: 16-Sep-2009
# Posted on: 13-Oct-2009 15:35:41   

I don't necessarily have to use prefetchPaths, they just seemed the easiest.

Is there a way to make llblgen generate and use 1 query, regardless of the method? could you give an example in linq or whatever else is possible? (excluding SPs and dynamiclist - as I need to bring back a strongly typed object)

I understand that multiple queries are great for a situation like order/orderDetails, but for lookup tables on entities, it's less than helpful performance-wise.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 13-Oct-2009 21:46:58   

Sorry there is no way to make LLBLGen do what you need. If you need to fetch a strongly typed object graph LLBLGen will always generate one query per entity type. This is for ease of converting the fetched data into the entites.

As David said, if you do just want a flat table containing the same data then TypedLists or DynamicLists will be fetched using a single query.

It really depends on what you want to do with the data once you have retrieved it.

Matt