For the N+1 queries issue in Hibernate, I add @BatchSize(size=20)
on collection and class level. And it works very well as it fetches 20 records each time.
Now I found that there is a hibernate.jdbc.fetch_size
configuration option which I think it is the same as @BatchSize
annotation.
However, it has no effect to the N+1 queries issue when I configured it in my project.
Am I wrong with hibernate.jdbc.fetch_size
?
What is hibernate.jdbc.fetch_size
for?