gitlab-org--gitlab-foss/app/services/issues
Yorick Peterse 6ec53f5d48
Cache the number of open issues and merge requests
Every project page displays a navigation menu that in turn displays the
number of open issues and merge requests. This means that for every
project page we run two COUNT(*) queries, each taking up roughly 30
milliseconds on GitLab.com. By caching these numbers and refreshing them
whenever necessary we can reduce loading times of all these pages by up
to roughly 60 milliseconds.

The number of open issues does not include confidential issues. This is
a trade-off to keep the code simple and to ensure refreshing the data
only needs 2 COUNT(*) queries instead of 3. A downside is that if a
project only has 5 confidential issues the counter will be set to 0.

Because we now have 3 similar counting service classes the code
previously used in Projects::ForksCountService has mostly been moved to
Projects::CountService, which in turn is reused by the various service
classes.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36622
2017-08-23 13:42:29 +02:00
..
base_service.rb Move duplicate issue management to a service 2017-07-21 12:53:56 +01:00
build_service.rb Refactor resolvability checks based on type 2017-04-06 10:51:45 -05:00
close_service.rb Support both internal and external issue trackers 2017-07-24 08:13:43 +02:00
create_service.rb Cache the number of open issues and merge requests 2017-08-23 13:42:29 +02:00
duplicate_service.rb Move duplicate issue management to a service 2017-07-21 12:53:56 +01:00
move_service.rb Native group milestones 2017-07-07 15:08:49 +00:00
reopen_service.rb Merge issuable "reopened" state into "opened" 2017-07-28 13:31:51 +02:00
update_service.rb Move duplicate issue management to a service 2017-07-21 12:53:56 +01:00