Details
Description
When passing a $comment in a query count() doesn't use an index.
Testcase:
> for (var i=0; i < 1000000; i++) db.test.insert({a:i})
|
> db.test.count()
|
1000001
|
> db.test.count({$comment:"A"})
|
1000001
|
> var start = new ISODate(); db.test.count(); new ISODate() - start
|
0
|
> var start = new ISODate(); db.test.count({$comment:"A"}); new ISODate() - start
|
155
|
Attachments
Issue Links
- is duplicated by
-
SERVER-25830 $comment on an empty query causes a collection scan
-
- Closed
-
- is related to
-
DOCS-9392 3.4: Behavior change for count with hint and empty query predicate on sparse index
-
- Closed
-