Question - How to solve N+1 SELECT problem in Hibernate?
Answer -
Some of the strategies followed for solving the N+1 SELECT problem are:
Pre-fetch the records in batches which helps us to reduce the problem of N+1 to (N/K) + 1 where K refers to the size of the batch.
Subselect the fetching strategy
As last resort, try to avoid or disable lazy loading altogether.