Commit c30a44e4 authored by Stan Hu's avatar Stan Hu

Merge branch 'aa-refactor-merge-requests-users-counter' into 'master'

Optimize merge requests users usage data

See merge request gitlab-org/gitlab!36028
parents 0cd724f8 5c038325
......@@ -420,9 +420,8 @@ module Gitlab
distinct_count(
query,
:author_id,
batch_size: 5_000, # Based on query performance, this is the optimal batch size.
start: User.minimum(:id),
finish: User.maximum(:id)
start: user_minimum_id,
finish: user_maximum_id
)
end
# rubocop: enable CodeReuse/ActiveRecord
......
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