Before this change, we used extremely inefficient outer joins as part of a single query of lookup, which was spiking our CPU usage to nearly 100% on the query. We now issue two separate queries for popularity and action account, by doing a lookup of the previously found IDs. Interestingly enough, because of the way the queries are now written, MySQL can actually do both queries *directly from the indicies*, which means they each occur in approx 20ms! Verified by local tests, postgres tests, and testing on staging with monitoring of our CPU usage during lookup |
||
|---|---|---|
| .. | ||
| migrations | ||
| model | ||
| __init__.py | ||
| archivedlogs.py | ||
| billing.py | ||
| buildlogs.py | ||
| database.py | ||
| queue.py | ||
| read_slave.py | ||
| runmigration.py | ||
| userevent.py | ||
| userfiles.py | ||
| users.py | ||