title: MongoDB 'count()' is very slow. How do we refine/work around with it?
body: <p>I am currently using MongoDB with millions of data records. I discovered one thing that's pretty annoying.</p>
  
  <p>When I use 'count()' function with a small number of queried data collection, it's very fast. However, when the queried data collection contains thousand or even millions of data records, the entire system becomes very slow.</p>
  
  <p>I made sure that I have indexed the required fields.</p>
  
  <p>Has anybody encountered an identical thing? How do you do to improve that?</p>