Commit e10d543b authored by Stan Hu's avatar Stan Hu

Unscope Event push count for better performance

The Event default_scope was causing the query to use the wrong index,
causing the query to scan through all rows unnecessarily.
parent f0c6b9cf
Please view this file on the master branch, on stable branches it's out of date.
## 8.13.0 (2016-10-22)
v 8.13.0 (unreleased)
- Cache the last usage data to avoid unicorn timeouts
- Cache the last usage data to avoid unicorn timeouts
- Add user activity table and service to query for active users
- Fix 500 error updating mirror URLs for projects
- Restrict protected branch access to specific groups !645
......
......@@ -36,7 +36,8 @@ module Gitlab
merge_requests: MergeRequest.count,
milestones: Milestone.count,
notes: Note.count,
pushes: Event.code_push.count,
# Default scope causes this query to run for a long time
pushes: Event.unscoped.code_push.count,
pages_domains: PagesDomain.count,
projects: Project.count,
protected_branches: ProtectedBranch.count,
......
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