Memoize Milestoneish#issues_visible_to_user to reduce lookups
What does this MR do?
https://gitlab.com/gitlab-org/gitlab-ce/issues/25748
Milestones page are erroring out with 502
due to Milestoneish#issues_visible_to_user
taking too long.This patch attempts to provide a temporary improvement by reducing the number of times it is called, and speeding up the SQL query when it is on an individual milestone.
GlobalMilestones used on the Dashboard and in Groups still have a very slow SQL query so the issue is being left open.
Versions affected
8.13, 8.14. 8.15
Severity
Important, partially fixes broken milestones index.
Does this MR meet the acceptance criteria?
-
Changelog entry added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together