• Yorick Peterse's avatar
    Use a UNION in MergeRequest.in_projects · 4f3fa519
    Yorick Peterse authored
    The OR condition for source_project_id/target_project_id leads to a
    query plan that performs rather poorly on PostgreSQL due to the use of
    sub-queries. Because Rails offers no easy alternative for this
    particular problem we're forced to using a UNION for both conditions.
    The resulting query performs much faster than just using an OR.
    4f3fa519
merge_request_spec.rb 12.5 KB