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:
commit
099b4063d2
2 changed files with 2 additions and 1 deletions
|
|
@ -14,6 +14,7 @@
|
||||||
* Update and refactor the default public view `public/default.html` [#3811](https://github.com/diaspora/diaspora/issues/3811)
|
* 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)
|
* 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)
|
* 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
|
## Features
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ class StatusMessage < Post
|
||||||
|
|
||||||
private
|
private
|
||||||
def self.tag_stream(tag_ids)
|
def self.tag_stream(tag_ids)
|
||||||
joins(:tags).where(:tags => {:id => tag_ids})
|
joins(:taggings).where('taggings.tag_id IN (?)', tag_ids)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue