Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api] Fix huge bottleneck in notification emails
The way source_watchers and target_watchers were implemented was pretty suboptimal. It took >20 seconds to dig out 128 users watching openSUSE:Factory by going through the WatchedProject objects connected to these 128 users and listed the users for these, which resulted in 128x128 SELECT user ... - but all we want is the list of 128 User objects (to filter subscriptions for them) So the new query results in one SQL statement taking the database a friction of a second
- Loading branch information