Scope rejected projects query for better performance
What does this MR do and why?
Improves performance of determining which projects to filter out by scoping the projects to a subset of projects instead off all projects.
Before:
Project.public_or_visible_to_user
After:
Project.id_in(scoped_project_ids).public_or_visible_to_user(current_user)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #438704 (closed)
Edited by Madelein van Niekerk