Skip to content

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.

Third iteration @yorickpeterse suggestion to avoid user instances allocations

Screen_Shot_2016-10-19_at_12.29.06

Second iteration after the introduction of !743 (merged)

Before

Screen_Shot_2016-10-18_at_09.34.41

After

Screen_Shot_2016-10-18_at_09.46.16

First iteration before the introduction of !743 (merged) (#180 (closed))

Before

Screen_Shot_2016-10-10_at_11.39.54

After

Screen_Shot_2016-10-10_at_12.06.12

Merge request reports