Skip to content

Use batch loader for loading epic issues

Jan Provaznik requested to merge epic-issues-loading into master

What does this MR do?

Use batch loader for loading epic issues

Avoids N+1 query issues when loading many epics including their issues. Batch loader is used for loading these items, downside is that we load all issues for each epic into memory - given the use-case this should be acceptable (number of issues per epic is relatively small). To avoid extra queries/checks, we authorize only issues being rendered instead of the whole array - downside is that less-than-limit number of items may be returned then.

So this solution is not perfect, but it doesn't make situation worse in any aspect - we already have N+1 issue, we already use array connection and we already load all issues into memory. Pros is that it fixes major problems with existing solution:

  • fixes N+1 issue
  • runs permissions check only on the set of issues being rendered (instead of on all of them)

Related to #11841 (closed)

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 🤖 GitLab Bot 🤖

Merge request reports