diff options
author | Stan Hu <stanhu@gmail.com> | 2018-05-15 23:06:55 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-05-16 08:27:48 -0700 |
commit | e38938b332ca751dfc5e784f242d620016e8ca43 (patch) | |
tree | 439a6672547ba9d50d995e7717df28ab6ded89fd /app/controllers/admin | |
parent | 0288e2525fbe2bc226726b5289fc6e5b3a949da2 (diff) | |
download | gitlab-ce-e38938b332ca751dfc5e784f242d620016e8ca43.tar.gz |
Fix Error 500 viewing admin page due to statement timeouts
Uses PostgreSQL tuple estimates to provide a much faster yet approximate
count. See https://wiki.postgresql.org/wiki/Slow_Counting for more details.
We only use this fast method if the table has been analyzed or vacuumed
within the last hour.
Closes #46255
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/dashboard_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index e85cdcb8db7..d6a6bc7d4a1 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -1,4 +1,6 @@ class Admin::DashboardController < Admin::ApplicationController + include CountHelper + def index @projects = Project.order_id_desc.without_deleted.with_route.limit(10) @users = User.order_id_desc.limit(10) |