Skip to content

Make removable check less expensive

What does this MR do and why?

Make removable checks less expensive

The previous query loads the entire solo-owned groups to memory and checked the presence using .present? method. This causes memory bloat as loading 10k+ groups to memory at the same time will consume Gigabytes of memory for a single request. This commit fixes this behaviour by delegating this check to the database.

This MR doesn't address the N+1 query, as removing unnecessary allocation is enough to reach an acceptable performance level

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #417105 (closed)

Edited by Jessie Young

Merge request reports

Loading