What does this MR do?
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.
8.13, 8.14. 8.15
Important, partially fixes broken milestones index.
Does this MR meet the acceptance criteria?
Changelog entry added
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