Created
January 26, 2014 16:11
-
-
Save ixti/8635026 to your computer and use it in GitHub Desktop.
MongoDB, are you serious???
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % mongo | |
| MongoDB shell version: 2.4.2 | |
| connecting to: test | |
| > db.t1.ensureIndex({ username: 1 }, { sparse: true }); | |
| > db.t1.find({ deleted_at: { $exists: false }, username: "foo" }).explain() | |
| { | |
| "cursor" : "BasicCursor", | |
| "isMultiKey" : false, | |
| "n" : 0, | |
| "nscannedObjects" : 3, | |
| "nscanned" : 3, | |
| "nscannedObjectsAllPlans" : 3, | |
| "nscannedAllPlans" : 3, | |
| "scanAndOrder" : false, | |
| "indexOnly" : false, | |
| "nYields" : 0, | |
| "nChunkSkips" : 0, | |
| "millis" : 1, | |
| "indexBounds" : { | |
| }, | |
| "server" : "silver:27017" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI, a fix has been committed for this: https://jira.mongodb.org/browse/SERVER-10005. It will be in the next dev release (2.5.5) and 2.6 prod release. This issue was related to query optimiser changes for https://jira.mongodb.org/browse/SERVER-3918; the workaround is to "hint" as you are doing.