Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21302

Possible to run COLSCAN with --notablescan if there is no query specified

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • ALL
    • Hide
      MongoDB shell version: 3.2.0-rc0
      connecting to: bmx10201:30001/test
      Server has startup warnings: 
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] 
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] ** WARNING: You are running on a NUMA machine.
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] **          We suggest launching mongod like this to avoid performance problems:
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] **              numactl --interleave=all mongod [other options]
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] 
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
      2015-11-05T12:41:17.080+0000 I CONTROL  [initandlisten] 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.getSiblingDB("admin").runCommand( { setParameter: 1, notablescan: 1 } )
      { "was" : false, "ok" : 1 }
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> use test
      switched to db test
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.createCollection("a")
      { "ok" : 1 }
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> for(var i=0;i++<10000;){db.a.insert({b:i});}
      WriteResult({ "nInserted" : 1 })
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.a.find()
      { "_id" : ObjectId("563b57861c2396459464a8ff"), "b" : 1 }
      { "_id" : ObjectId("563b57861c2396459464a900"), "b" : 2 }
      { "_id" : ObjectId("563b57861c2396459464a901"), "b" : 3 }
      { "_id" : ObjectId("563b57861c2396459464a902"), "b" : 4 }
      { "_id" : ObjectId("563b57861c2396459464a903"), "b" : 5 }
      { "_id" : ObjectId("563b57861c2396459464a904"), "b" : 6 }
      { "_id" : ObjectId("563b57861c2396459464a905"), "b" : 7 }
      { "_id" : ObjectId("563b57861c2396459464a906"), "b" : 8 }
      { "_id" : ObjectId("563b57861c2396459464a907"), "b" : 9 }
      { "_id" : ObjectId("563b57861c2396459464a908"), "b" : 10 }
      { "_id" : ObjectId("563b57861c2396459464a909"), "b" : 11 }
      { "_id" : ObjectId("563b57861c2396459464a90a"), "b" : 12 }
      { "_id" : ObjectId("563b57861c2396459464a90b"), "b" : 13 }
      { "_id" : ObjectId("563b57861c2396459464a90c"), "b" : 14 }
      { "_id" : ObjectId("563b57861c2396459464a90d"), "b" : 15 }
      { "_id" : ObjectId("563b57861c2396459464a90e"), "b" : 16 }
      { "_id" : ObjectId("563b57861c2396459464a90f"), "b" : 17 }
      { "_id" : ObjectId("563b57861c2396459464a910"), "b" : 18 }
      { "_id" : ObjectId("563b57861c2396459464a911"), "b" : 19 }
      { "_id" : ObjectId("563b57861c2396459464a912"), "b" : 20 }
      Type "it" for more
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.a.find({a:1})
      Error: error: {
      	"waitedMS" : NumberLong(0),
      	"ok" : 0,
      	"errmsg" : "error processing query: ns=test.aTree: a == 1.0\nSort: {}\nProj: {}\n No query solutions",
      	"code" : 2
      }
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.a.find().explain()
      {
      	"waitedMS" : NumberLong(0),
      	"queryPlanner" : {
      		"plannerVersion" : 1,
      		"namespace" : "test.a",
      		"indexFilterSet" : false,
      		"parsedQuery" : {
      			"$and" : [ ]
      		},
      		"winningPlan" : {
      			"stage" : "COLLSCAN",
      			"filter" : {
      				"$and" : [ ]
      			},
      			"direction" : "forward"
      		},
      		"rejectedPlans" : [ ]
      	},
      	"serverInfo" : {
      		"host" : "bmx10201",
      		"port" : 30001,
      		"version" : "3.2.0-rc0",
      		"gitVersion" : "bf28bd20fa507c4d8cc5919dfbbe87b7750ae8b0"
      	},
      	"ok" : 1
      }
      MongoDB Enterprise M32_TST_SHARD0:PRIMARY> 
      
      Show
      MongoDB shell version: 3.2.0-rc0 connecting to: bmx10201:30001/test Server has startup warnings: 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] ** WARNING: You are running on a NUMA machine. 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] ** We suggest launching mongod like this to avoid performance problems: 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] ** numactl --interleave=all mongod [other options] 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2015-11-05T12:41:17.080+0000 I CONTROL [initandlisten] MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.getSiblingDB("admin").runCommand( { setParameter: 1, notablescan: 1 } ) { "was" : false, "ok" : 1 } MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> use test switched to db test MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.createCollection("a") { "ok" : 1 } MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> for(var i=0;i++<10000;){db.a.insert({b:i});} WriteResult({ "nInserted" : 1 }) MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.a.find() { "_id" : ObjectId("563b57861c2396459464a8ff"), "b" : 1 } { "_id" : ObjectId("563b57861c2396459464a900"), "b" : 2 } { "_id" : ObjectId("563b57861c2396459464a901"), "b" : 3 } { "_id" : ObjectId("563b57861c2396459464a902"), "b" : 4 } { "_id" : ObjectId("563b57861c2396459464a903"), "b" : 5 } { "_id" : ObjectId("563b57861c2396459464a904"), "b" : 6 } { "_id" : ObjectId("563b57861c2396459464a905"), "b" : 7 } { "_id" : ObjectId("563b57861c2396459464a906"), "b" : 8 } { "_id" : ObjectId("563b57861c2396459464a907"), "b" : 9 } { "_id" : ObjectId("563b57861c2396459464a908"), "b" : 10 } { "_id" : ObjectId("563b57861c2396459464a909"), "b" : 11 } { "_id" : ObjectId("563b57861c2396459464a90a"), "b" : 12 } { "_id" : ObjectId("563b57861c2396459464a90b"), "b" : 13 } { "_id" : ObjectId("563b57861c2396459464a90c"), "b" : 14 } { "_id" : ObjectId("563b57861c2396459464a90d"), "b" : 15 } { "_id" : ObjectId("563b57861c2396459464a90e"), "b" : 16 } { "_id" : ObjectId("563b57861c2396459464a90f"), "b" : 17 } { "_id" : ObjectId("563b57861c2396459464a910"), "b" : 18 } { "_id" : ObjectId("563b57861c2396459464a911"), "b" : 19 } { "_id" : ObjectId("563b57861c2396459464a912"), "b" : 20 } Type "it" for more MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.a.find({a:1}) Error: error: { "waitedMS" : NumberLong(0), "ok" : 0, "errmsg" : "error processing query: ns=test.aTree: a == 1.0\nSort: {}\nProj: {}\n No query solutions", "code" : 2 } MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> MongoDB Enterprise M32_TST_SHARD0:PRIMARY> db.a.find().explain() { "waitedMS" : NumberLong(0), "queryPlanner" : { "plannerVersion" : 1, "namespace" : "test.a", "indexFilterSet" : false, "parsedQuery" : { "$and" : [ ] }, "winningPlan" : { "stage" : "COLLSCAN", "filter" : { "$and" : [ ] }, "direction" : "forward" }, "rejectedPlans" : [ ] }, "serverInfo" : { "host" : "bmx10201", "port" : 30001, "version" : "3.2.0-rc0", "gitVersion" : "bf28bd20fa507c4d8cc5919dfbbe87b7750ae8b0" }, "ok" : 1 } MongoDB Enterprise M32_TST_SHARD0:PRIMARY>

      Notablescan is omitted when there is no query specified for find or remove

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            atozser Attila Tozser
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: