thewca / worldcubeassociation.org

All of the code that runs on worldcubeassociation.org
https://www.worldcubeassociation.org/
GNU General Public License v3.0
330 stars 176 forks source link

Optimize site search #249

Closed jfly closed 3 years ago

jfly commented 8 years ago

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.

keemy commented 8 years ago

The first optimization (if ever needed) should just be limit api to 2 or 3 + chars

jfly commented 8 years ago

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'
gregorbg commented 3 years ago

Closing due to inactivity. If you think this is still relevant, feel free to reopen!