Reduce number of queries when querying MR approvers/approvals
Relates to gitlab-org/gitlab-ce#23100
This MR does not solve the related issue but reduce the number of executed queries. This MR reduce the database queries in the MR show action when the MR approval feature is on. These are the number of queries on a MR that requires two approvals and only one is made already.
@yorickpeterse suggestion to avoid user instances allocations
Third iteration!743 (merged)
Second iteration after the introduction ofBefore
After
!743 (merged) (#180 (closed))
First iteration before the introduction ofBefore
After
Edited by Coung Ngo