Added EachBatch for iterating tables in batches
This allows for traversing tables in a way that's more efficient than Rails' in_batches
(which is too complex to adjust for this while still supporting the old features).
This is necessary for https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12513, but it can also be very useful in the future.
I have deliberately left update_column_in_batches
as-is since I don't feel comfortable immediately changing its behaviour to use this new code.
EE version of this MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2377
Edited by yorickpeterse-staging