Commit 18e224eb authored by Stan Hu's avatar Stan Hu

Merge branch 'partial-revert-schedule-merge-request-diffs' into 'master'

Partially revert "Optimise the external diff storage migration query"

See merge request gitlab-org/gitlab!38789
parents 52083dab 68411dfd
...@@ -115,15 +115,7 @@ class MergeRequestDiff < ApplicationRecord ...@@ -115,15 +115,7 @@ class MergeRequestDiff < ApplicationRecord
end end
def ids_for_external_storage_migration_strategy_always(limit:) def ids_for_external_storage_migration_strategy_always(limit:)
ids = [] has_diff_files.files_in_database.limit(limit).pluck(:id)
files_in_database.each_batch(column: :merge_request_id, order_hint: :id) do |scope|
ids.concat(scope.has_diff_files.pluck(:id))
break if ids.count >= limit
end
ids.first(limit)
end end
def ids_for_external_storage_migration_strategy_outdated(limit:) def ids_for_external_storage_migration_strategy_outdated(limit:)
......
---
title: Optimise the external diff storage migration query
merge_request: 38579
author:
type: performance
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment