commercialhaskell / stackage-server

Server for stable, curated Haskell package sets
MIT License
106 stars 27 forks source link

Attempt to fix slow queries #303

Closed lehins closed 3 years ago

lehins commented 3 years ago

Looks like it's impossible to reopen PR after a force push, so here is a new one instead of #302

This one definitely improves things quite a bit. Trick is in the index on sorting on lts creation date.

I could never replicate it locally because it turns database/hdd cache was always kicking in on subsequent queries, so I would never notice stackage.org/package/packagename page to be that slow until today. That's why benchmarks of the query also run incredibly fast, because a query that is being benchmarked doesn't change.

snoyberg commented 3 years ago

Cool, I've added the index to the production database, let's see if that fixes things.