Skip to content

Added EachBatch for iterating tables in batches

Yorick Peterse requested to merge active-record-each-batch into master

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

cc @grzesiek @ayufan

Edited by Yorick Peterse

Merge request reports