Resolve an N+1 in merge request CI variables
When building a CI pipeline, variables must be gathered at least once per build, so it's important that the variable declarations ensure any activerecord-dependent data is cached on the first call, to avoid repeated SQL queries. For this case, `present?` loads the list of assignees into memory for subsequent calls, while `any?` issues a simple `EXISTS` query that is repeated each time.
Showing
Please register or sign in to comment