Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4581

2.6 covered queries for sharded collections

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • v1.3.16, mongodb-2.6
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      queries on sharded collections run against primary can be covered. Behavior seems to have changed starting 2.6.4.

      mongos limitation seem unchanged (until 2.8)

      MongoDB shell version: 2.6.3
      connecting to: 127.0.0.1:27018/test
      shardA:PRIMARY> db.foo.find( { a: 1 }, { _id: 0 } ).explain()
      {
      	"cursor" : "BtreeCursor a_1",
      	"isMultiKey" : false,
      	"n" : 1,
      	"nscannedObjects" : 1,
      	"nscanned" : 1,
      	"nscannedObjectsAllPlans" : 1,
      	"nscannedAllPlans" : 1,
      	"scanAndOrder" : false,
      	"indexOnly" : false,
      
      
      sharda-265:PRIMARY> db.foo.find( { a: 1}, { a: 1, _id: 0 } ).explain()
      {
      	"cursor" : "BtreeCursor a_1_b_1",
      	"isMultiKey" : false,
      	"n" : 1,
      	"nscannedObjects" : 0,
      	"nscanned" : 1,
      	"nscannedObjectsAllPlans" : 0,
      	"nscannedAllPlans" : 2,
      	"scanAndOrder" : false,
      	"indexOnly" : true,
      
      

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 16 weeks, 2 days ago