-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.0.0
-
Component/s: Index Maintenance, Performance
-
Environment:All
-
ALL
On a test set of 5 million records with one of the fields having a value ranging from 0-1000 we're getting some odd performance :
> d1 = new Date(); db.test.distinct("a"); print(new Date()-d1)
4086
> d1 = new Date(); db.test.distinct("a"); print(new Date()-d1)
4078
> db.test.ensureIndex(
)
> d1 = new Date(); db.test.distinct("a"); print(new Date()-d1)
9181
> d1 = new Date(); db.test.distinct("a"); print(new Date()-d1)
9183
Is there any reasonable explanation for this? It would seem that even if for some reason an index causes degraded performance the code shouldn't try and use it (the distinct code on the server implies it should be an optimization)