Fix the slow running queries for collections (bug 1090963)
Merge pull request #351 from magopian/1090963-fix-slow-running-collections-queries

Fix the slow running queries for collections (bug 1090963)