Optimise rendering of Markdown documents that belong to different projects
What does this MR do?
We extend the Markdown pipeline so we can render multiple documents that may belong to different projects.
These changes combined can quite drastically reduce the number of SQL queries necessary in various places. For example, when displaying the Atom feed of a group these changes reduced the number of SQL queries from 58 to 39 (when combining these changes with !18217 (merged)).
EE merge request: gitlab-ee!5308 (merged)
Why was this MR needed?
We keep running into N+1 query problems with the Markdown pipeline. Further, the Groups atom feed would group events per project and render them separately; resulting in many SQL queries being executed.
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Tests added for this feature/bug
- 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
End-to-end tests pass (
package-and-qamanual pipeline job)