diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 03:08:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 03:08:11 +0300 |
commit | 23bc19cb73aad969c9636b8b935111645e809e54 (patch) | |
tree | 887c9e014f8345f577769db4f75315ca59853b98 /lib | |
parent | c4db541c1b2c97ab1eda354ea3899489fe5c33e5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/database/batch_count.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/database/batch_count.rb b/lib/gitlab/database/batch_count.rb index 728e0d423af..8972b77abef 100644 --- a/lib/gitlab/database/batch_count.rb +++ b/lib/gitlab/database/batch_count.rb @@ -32,8 +32,8 @@ module Gitlab MAX_ALLOWED_LOOPS = 10_000 SLEEP_TIME_IN_SECONDS = 0.01 # 10 msec sleep # Each query should take <<500ms https://gitlab.com/gitlab-org/gitlab/-/merge_requests/22705 - DEFAULT_DISTINCT_BATCH_SIZE = 100_000 - DEFAULT_BATCH_SIZE = 10_000 + DEFAULT_DISTINCT_BATCH_SIZE = 10_000 + DEFAULT_BATCH_SIZE = 100_000 def initialize(relation, column: nil) @relation = relation @@ -51,7 +51,7 @@ module Gitlab raise "The mode #{mode.inspect} is not supported" unless [:itself, :distinct].include?(mode) # non-distinct have better performance - batch_size ||= mode == :distinct ? DEFAULT_BATCH_SIZE : DEFAULT_DISTINCT_BATCH_SIZE + batch_size ||= mode == :distinct ? DEFAULT_DISTINCT_BATCH_SIZE : DEFAULT_BATCH_SIZE start = @relation.minimum(@column) || 0 finish = @relation.maximum(@column) || 0 |