I narrowed down the problem to the fact that we were joining in pet types against assets, and *then* running GROUP and DISTINCT and everything. Assets x compatible species/color pairs is a LOT of rows! Here, we instead get all the relevant body IDs first, and *then* match them against pet types—which we fetch in one batch to match body to canonical species/color. I'm also trashing the weird caching mechanism we did here, because in practice it doesn't seem reliable anyway. If anything, I'd want to look at stronger CDN caching. (I made a small improvement to the caching annotation, but ultimately it still doesn't matter, because this query uses logged-in stuff and always comes out max-age=0 anyway.) |
||
|---|---|---|
| .. | ||
| exported-user-data | ||
| build-cached-data.js | ||
| cache-asset-manifests.js | ||
| delete-user.js | ||
| export-users-to-auth0.js | ||
| setup-mysql-dev-constants.sql | ||
| setup-mysql-dev-schema.sql | ||
| setup-mysql.sql | ||