Skip to content

Batch loading of open issues count from Redis

Heinrich Lee Yu requested to merge 220320-use-mget-for-open-issues-count into master

What does this MR do?

For API endpoints that have a list of projects, we batch the fetching of open issue counts using MGET to reduce Redis calls.

This reuses the approach used in !35328 (merged) for the forks count and adds some improvements

How to setup and validate locally (strongly suggested)

  1. Add a request to the projects API localhost:3000/api/v4/projects to the performance bar
  2. Look at the Redis calls

You should see the N+1 for open_issues_count being replaced by a single MGET call.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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

Related to #220320 (closed)

Edited by Heinrich Lee Yu

Merge request reports

Loading