Currently we create several loaders following a certain algorithm
Why don't we create a single loader of batch-size and duplicate ids in the in clause to match unfilled parameters

batch-size = 20
uninitialized proxies 17

current algorithm
select * from Table where id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
select * from Table where id in (11, 12, 13, 14, 15, 16, 17)

current algorithm
select * from Table where id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 17, 17, 17)

This would reduce the memory footprint and reduce the prepared statement pool needed

This case is a sample but it shines when people set up a batch-size of 100 since the number of queries triggered can drop from 5 to 1 query for 98 uninitialized proxies
_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to