Skip to content

Update ReleasesFinder to reduce queries

Leaminn Ma requested to merge releases-finder-reduce-queries into master

What does this MR do and why?

This MR addresses the discussion in #412364 (closed) to apply an optimization to the ReleasesFinder so it executes fewer queries.

Here we replace Project.id_in(parent.map(&:id)).include_project_feature with ActiveRecord::Associations::Preloader.new(records: parent, associations: :project_feature).call so that we reuse the existing list of projects instead of pulling them anew from the database.

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 #412364 (closed)

Edited by Leaminn Ma

Merge request reports