Merge pull request #3932 from marpo60/improve-tags-query

don't join the tags table here, it makes the query slower
This commit is contained in:
Jonne Haß 2013-01-29 03:56:49 -08:00
commit 099b4063d2
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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