SQL/Drizzle Where Query Search Optimization
Hi, originally I wanted a fuzzy search but now I just wanted to look how far I can get with just a where query.
I have a few concerns with the reads this query causes to the database.
Especially I want to know if I can stop if I already have 5 via the name or if you generally have some read and performance optimizations.
4 Replies
you can write the query and would technically get the same result
you can also use
ilike
if you dont want it to be case sensitivelike/ilike searches are awful to optimize
basically impossible without the proper tool
Ok, I will try a different way
Ilike is not supported by SQLite anyway
does it make sense to make a composite index with the name, germanName and region?
currently I only have an index of each of them alonely
One thing you can do - although it leads to some complications and redundancy - create a new field where you concat name, germanName and region and then you can search only that one field
However, now you will have to update that field whenever any of the other 3 changes