Closed jfly closed 3 years ago
The first optimization (if ever needed) should just be limit api to 2 or 3 + chars
A quick hack to get the set of all search queries that have been done:
ssh wca 'sed -n "s/^.*api\/v0\/search?q=\([^\"]*\).*$/\1/p" /home/cubing/worldcubeassociation.org/WcaOnRails/log/production.log'
Closing due to inactivity. If you think this is still relevant, feel free to reopen!
As of https://github.com/cubing/worldcubeassociation.org/pull/242, we just dumbly do 2 or 3 LIKE queries against different tables in our database. Performance actually does seem acceptable with this implementation, but there are lots of things we look in to to optimize this:
@keemy also suggested using Redis as a tool to cache repeated queries.