[hibernate-dev] batch-size algorithm

Max Rydahl Andersen max.andersen at jboss.com
Thu Sep 28 09:00:13 EDT 2006


sounds reasonable IFF the db doesn't get stupid and does 20 lookups for  
duplicate id's.

/max

> 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev



-- 
--
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
max at hibernate.org
http://hibernate.org

JBoss a division of Red Hat
max.andersen at jboss.com




More information about the hibernate-dev mailing list