rockskip: Optimize case insensitive queries
Created by: chrismwendt
This adds indexes on lower(name)
and lower(path)
(and various combinations).
The symbols sidebar doesn't send case sensitive queries, so it was timing out on the megarepo without these indexes.
The logic got a bit unwieldy so I flattened it out. There might be a better way to write this. Is it readable as is?
Test plan
Ran through all these cases by running different queries in the search bar: