title: MongoDB count very slow
body: <p>I have a collection with 1.5 million documents. I'm counting using PHP:</p>
  
  <pre><code>$db-&gt;some-&gt;ensureIndex(array("sometext" =&gt; 1));
  $db-&gt;some-&gt;ensureIndex(array("datsbla" =&gt; 1));
  $arr["sometext"] = $string; 
  $arr["datsbla"] = array('$gte' =&gt; $some, '$lte' =&gt; $thing);
  $count = $db-&gt;some-&gt;count($arr);
  </code></pre>
  
  <p>I turned on the profiler and every count like that is like 4500 ms. I have 20 counters like that in my page, so it makes my web page VERY VERY SLOW.</p>
  
  <p>What should I do to make it faster (&lt; 100 ms) ? Is it even possible using MongoDB?</p>
  
  <p>Thanks.</p>