PrefetchPath vs Lazy Loading

Posts   
 
    
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 25-Mar-2008 20:45:28   

Hello,

I used prefetchPath to improve performance. I tought it would make only one access to the database to have less request to the database. Less back and forth.

I enabled "traces" and look queries when we used prefetch pathes.

It does not generate only one request. It generate a first request plus a request for each entity in the path. What's that ??????????? It does not generate only one sql ?????? It will be like 1000 times less quick than only one request (with joins) with all fields.

What I don't understand ? What I'm missing ?

I hope nobody will tell me that i'm better to do 1000 requests instead of having merged 1-n related fields that some would be duplicated... frowning frowning frowning !!!!!!!! ... what consistency it will be ... (does it use transaction to ensure consistency .... ???? ) (does it freeze records for all the time of the transaction.... ????) frowning

I should have missed something ... What ?

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 25-Mar-2008 21:01:55   

Please post your code and the generated sql so we can understand better.

Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 25-Mar-2008 21:15:40   

SORRY !!!

CODE 18 !!!! flushed (problem at 18 inches of the screen)

I'm too fast on the switch ! Sorry. I will verify things more deeply next time.

Thanks a lot for having answering fast !

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 25-Mar-2008 21:24:38   

Wally, it's called PEBKAC wink

Frans Bouma | Lead developer LLBLGen Pro
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 26-Mar-2008 14:02:39   

Thanks,

I look in Wikipedia... and you are right, I will go to bed a little bit less stupid tonight smile