• Nick Thomas's avatar
    Resolve an N+1 in merge request CI variables · a8961dca
    Nick Thomas authored
    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.
    a8961dca
merge_request_spec.rb 117 KB