Labels::TransferService handles large amounts of label_links
Original thread at https://gitlab.com/gitlab-com/request-for-help/-/work_items/4321#note_3182473247 The label transfer service is currently fetching ALL relevant label_links associated with group labels that are also present in any issue or merge request associated with the project that is being transferred. ### Proposed fix We could get label link IDs with separate queries, one per label we are moving, but this might also be inefficient and we could still get a large amount of label links associated to a single label. Instead, we can probably keep loading all relevant label links into memory, but we could use a batch process that will allow us to only load a certain amount of records from the DB at the time ### Potential complexity We need to make sure the batched queries perform well with existing indexes on the database, or we might need to add them
issue