Skip to content
  • Yorick Peterse's avatar
    Use a UNION for User.find_by_any_email · 6955b1e9df19
    Yorick Peterse authored
    This is significantly faster than using a sub-query, at least when run
    on the GitLab.com production database. The benchmarks are a lot slower
    now with these changes, most likely due to PostgreSQL choosing a
    different (and less efficient) plan based on the amount of data present
    in the test database.
    
    Thanks to @dlemstra for suggesting the use of a UNION.
    6955b1e9df19