Doing counts in MongoDB has always been a slow operation even on an indexed
field… until now. To do the count, it would iterate through every single
element in the index and try to match the key, giving a response time of
several seconds for just a million documents. It would be especially slow on
values with high cardinality, meaning that the count is high.
A bug-fix and an optimization using MongoDB’s B-trees.
This blog is called myNoSQL and it is written by me, Alex Popescu, a software architect with a passion for open source and communities.
It records my readings, learnings, and opinions on NoSQL databases, polyglot persistence, and distributed systems -- subjects that I'm passionate about.
The opinions expressed here are my own, and no other party necessarily agrees with them.
If you feel I'm biased, I probably am.