Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > db.foo.ensureIndex({a:1})
- > db.foo.ensureIndex({b:1})
- > db.foo.insert({a:1})
- > db.foo.insert({b:1})
- > db.foo.insert({a:1, b:1})
- > db.foo.find({$or:[{a:1}, {b:1}]}).explain()
- {
- "clauses" : [
- {
- "cursor" : "BtreeCursor a_1",
- "nscanned" : 2,
- "nscannedObjects" : 2,
- "n" : 2,
- "millis" : 0,
- "nYields" : 0,
- "nChunkSkips" : 0,
- "isMultiKey" : false,
- "indexOnly" : false,
- "indexBounds" : {
- "a" : [
- [
- 1,
- 1
- ]
- ]
- },
- "allPlans" : [
- {
- "cursor" : "BtreeCursor a_1",
- "indexBounds" : {
- "a" : [
- [
- 1,
- 1
- ]
- ]
- }
- }
- ]
- },
- {
- "cursor" : "BtreeCursor b_1",
- "nscanned" : 2,
- "nscannedObjects" : 2,
- "n" : 1,
- "millis" : 0,
- "nYields" : 0,
- "nChunkSkips" : 0,
- "isMultiKey" : false,
- "indexOnly" : false,
- "indexBounds" : {
- "b" : [
- [
- 1,
- 1
- ]
- ]
- },
- "allPlans" : [
- {
- "cursor" : "BtreeCursor b_1",
- "indexBounds" : {
- "b" : [
- [
- 1,
- 1
- ]
- ]
- }
- }
- ]
- }
- ],
- "nscanned" : 4,
- "nscannedObjects" : 4,
- "n" : 3,
- "millis" : 0
- }
Add Comment
Please, Sign In to add comment