[obs-commits] [openSUSE/open-build-service] b0d7d2: [api] Fix huge bottleneck in notification emails
Branch: refs/heads/master Home: https://github.com/openSUSE/open-build-service Commit: b0d7d263bee0b355ed2127d1660c1af1a9724c6f https://github.com/openSUSE/open-build-service/commit/b0d7d263bee0b355ed2127... Author: Stephan Kulow <coolo@suse.de> Date: 2017-12-11 (Mon, 11 Dec 2017) Changed paths: M src/api/app/models/event/request.rb Log Message: ----------- [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 Commit: ccda0573426bf6adb2f57e3b00a0ab1cb566ecb9 https://github.com/openSUSE/open-build-service/commit/ccda0573426bf6adb2f57e... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2017-12-11 (Mon, 11 Dec 2017) Changed paths: M src/api/app/models/event/request.rb Log Message: ----------- Merge pull request #4200 from coolo/optimize_watcher_query Fix huge bottleneck in notification emails Compare: https://github.com/openSUSE/open-build-service/compare/4e6efd8ae499...ccda05...
participants (1)
-
Ana María Martínez Gómez