librariesio / libraries.io

:books: The Open Source Discovery Service
https://libraries.io
GNU Affero General Public License v3.0
1.1k stars 206 forks source link

Combine Project.find_exact and find_lower into one SQL query. #3266

Closed tiegz closed 7 months ago

tiegz commented 7 months ago

the .or() ActiveRelation method lets us combine two conditions. This is one step towards fixing N+1s while updating project dependencies

tiegz commented 7 months ago

actually, we probably want to avert the "lower()" query if the first query works. I'm going to switch directions toward bulk loading these instead.