openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Simons <>
Subject Re: Problem with join fetch
Date Mon, 25 May 2009 12:01:07 GMT
Hello Catalina,

> If you define ToMany fetch type to EAGER, then a simple
>    select a from A
> will get all Bs and Cs loaded.

unfortunately, using EAGER does not solve the (N+1)-problem. If there are L instances of A
holds M instances of B and each b has N instances of C then there will be L*M*N queries
generated to get the instances of C.
In the case that we need to solve here, there are about L=100, M=15, N=2 and there's even
more level D with about 2 instances per each c. So there are about 6000 queries, to get
information that can be fetched in one single select.


View raw message