summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-03-15 17:18:14 -0700
committerStan Hu <stanhu@gmail.com>2018-03-15 20:48:04 -0700
commit351d0c28dc8912075fdbb0a28e7356633c837931 (patch)
tree3f5e29f0a033faf4a6b39919ee7edb153336b39d
parent16d92de1e2ef5c187f7826c5a15fbc2121273dde (diff)
downloadgitlab-ce-sh-optimize-admin-projects-page.tar.gz
Fix timeouts loading /admin/projects pagesh-optimize-admin-projects-page
These extra sort keys caused sequential scans on the namespaces and projects page. Removing them makes the page load on GitLab.com. Closes #44338
-rw-r--r--app/finders/admin/projects_finder.rb3
-rw-r--r--changelogs/unreleased/sh-optimize-admin-projects-page.yml5
2 files changed, 6 insertions, 2 deletions
diff --git a/app/finders/admin/projects_finder.rb b/app/finders/admin/projects_finder.rb
index d6bcd939522..5c507fe8d50 100644
--- a/app/finders/admin/projects_finder.rb
+++ b/app/finders/admin/projects_finder.rb
@@ -16,8 +16,7 @@ class Admin::ProjectsFinder
items = by_archived(items)
items = by_personal(items)
items = by_name(items)
- items = sort(items)
- items.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page])
+ sort(items).page(params[:page])
end
private
diff --git a/changelogs/unreleased/sh-optimize-admin-projects-page.yml b/changelogs/unreleased/sh-optimize-admin-projects-page.yml
new file mode 100644
index 00000000000..242ea758dab
--- /dev/null
+++ b/changelogs/unreleased/sh-optimize-admin-projects-page.yml
@@ -0,0 +1,5 @@
+---
+title: Fix timeouts loading /admin/projects page
+merge_request:
+author:
+type: performance