[batch] Fix slow /batches query (#10063)
[batch] Fix slow /batches query (#10063)

* [batch] Fix slow /batches query

* dan's fix
hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail