Fix N+1 query when displaying events
What does this MR do?
This fixes an N+1 query problem when displaying events (e.g. on https://gitlab.com/gitlab-org/gitlab-ce.atom). See the commit for more details.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - Review
-
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered