v3 - adapter, prefetchpath query optimisation

Posts   
 
    
miloszes
User
Posts: 222
Joined: 03-Apr-2007
# Posted on: 25-Nov-2010 11:08:29   

Hi,

is it possible to influence a query mechanism, that it'll use ids retreieved in previous query instead of making a sub query?

Example:

Let say, that we've got a 3 tables A,B and C all of them have a PK Id. When I Create a Filter on A and prefetch A->B->C LLBLGen sometimes (maybe always - not sure) when asks for elements of C it creates a 2 sub queries:

1) filter A and select Ids 2) select ids for B 3) select items for C

Usually it's not a problem because a DB handles it quite fast. The problem starts when a filter for A table is "heavy". It would be ok, if it be executed only once, not many times.

Is it some switch or mechanism which will change the behavior, that if a first query will be executed (with filter) the id's retrieved in that query will be used in the input of query 2 (so the sub query won't be created and instead of this will be just simple in)?

I know that I can achieve that "manually", but It'll be a ton of work for that in my case. Also the difference between sub queries and without it on the db site is 1,3s vs 7,8s.

Best Regards, MiloszeS

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 25-Nov-2010 12:05:37