Skip to content
  • Yorick Peterse's avatar
    Use a UNION in MergeRequest.in_projects · 219c13249605
    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.
    219c13249605