title: Querying more than 27 million documents in mongodb
body: <p>We have 27 million documents distributed among 3 shards, each containing approximately 9 million documents. Each document have ~15 indexed fields. The requirement is that we should be able to filter these documents using combinations of the indexed fields. The count() takes less than 20 seconds max for complex queries.</p>
  
  <p>We also need to extract a specific field of those documents that matched the filters using find(). However, sometimes this takes minutes to finish, especially if the result is more than 1 million documents. This is executed via web service call so sometimes a timeout occurs.</p>
  
  <p>I want to know if adding more shards can solve the problem or are there other optimizations that we can apply.</p>
  
  <p>Thanks!</p>