Update ReleasesFinder to reduce queries
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #412364 (closed)
Edited by Leaminn Ma