diff --git a/Changelog.md b/Changelog.md index 6cabd0a2e..cd96e0205 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ * Update and refactor the default public view `public/default.html` [#3811](https://github.com/diaspora/diaspora/issues/3811) * Write unicorn stderr and stdout [#3785](https://github.com/diaspora/diaspora/pull/3785) * Ported aspects to backbone [#3850](https://github.com/diaspora/diaspora/pull/3850) +* Join tagging's table instead of tags to improve a bit the query [#3932](https://github.com/diaspora/diaspora/pull/3932) ## Features diff --git a/app/models/status_message.rb b/app/models/status_message.rb index e4adc4f0a..e6c46cd4d 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -173,7 +173,7 @@ class StatusMessage < Post private def self.tag_stream(tag_ids) - joins(:tags).where(:tags => {:id => tag_ids}) + joins(:taggings).where('taggings.tag_id IN (?)', tag_ids) end end