Remove order by clause to improve query performance

parent 2963bc01
......@@ -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