Use batch loader for loading epic issues
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
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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