Skip to content

Fix N+1 issue in approval rules

Jan Provaznik requested to merge mr_nplus1_approvals into master

What does this MR do?

Removes N+1 SQL issue when getting list of approver IDs - we call overall_approver_ids for each approver in approved_approvers.

E.g. in this request which requests MR's widget.json this N+1 issue causes 43 of 112 SQL queries.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Jan Provaznik

Merge request reports