Commit 70263949 authored by Stan Hu's avatar Stan Hu

Merge branch '5880-repository-verification-slow-sql' into 'master'

Resolve "Slow SQL  queryid 3278237544  now 3597645274 in production"

Closes #5880

See merge request gitlab-org/gitlab-ee!5570
parents 5aad5fcc f354de33
......@@ -5,7 +5,6 @@ module Geo
.with_route
.joins(:repository_state)
.where(repository_outdated.or(wiki_outdated))
.order(last_repository_updated_at_asc)
.limit(batch_size)
end
......@@ -14,7 +13,6 @@ module Geo
.with_route
.joins(left_join_repository_state)
.where(repository_never_verified)
.order(last_repository_updated_at_asc)
.limit(batch_size)
end
......@@ -64,9 +62,5 @@ module Geo
def repository_never_verified
repository_state_table[:project_id].eq(nil)
end
def last_repository_updated_at_asc
Gitlab::Database.nulls_last_order('projects.last_repository_updated_at', 'ASC')
end
end
end
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