RUBY-787 Splitting list of indexes when batching