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