Suppose, we have 3 tables posts <= posts_tags => tags.
In our Spring Data repository:
// in PostRepository.java
@Query("select p from Post p left join fetch p.tags")
List<Post> findAll(Pageable pageable);
This is gonna be cartesian product and Hibernate cannot limit it or something else without doing it in memory when ALL this censored result is selected.
Let's imagine, we have 1000 posts each of them has 3-5 tags. This is gonna be the HELL!
Suppose, we have 3 tables
posts
<=posts_tags
=>tags
.In our Spring Data repository:
This is gonna be cartesian product and
Hibernate
cannot limit it or something else without doing it in memory when ALL this censored result is selected.Let's imagine, we have 1000 posts each of them has 3-5 tags. This is gonna be the HELL!