-
March 4th, 2021, 11:33 PM
#1
N+1 SELECT problem in Hibernate
Hello, Newbie exploring Hibernate. I was wondering if there are any detailed walkaround for the above problem. I found it on the [Link removed] that the below process would give us a solution. Wondering if there are any other solutions!
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.
Also, I also checked it in Stackoverflow. Felt it's a bit complicated!
TIA!!
Last edited by 2kaud; March 19th, 2021 at 03:18 AM.
Reason: Link removed
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|