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

_id query on capped collection warning can be printed incorrectly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.6, 2.1.1
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • ALL

      Wed Mar 21 16:37:37 [conn1] warning: _id query on capped collection without an _id index, performance will be poor collection: test.c
      

      This message is printed if there is a constraint on _id and there is a candidate collection scan plan. This means it can be printed when an _id index is present and is the basis of an additional candidate plan. For example:

      > db.createCollection( 'c', { capped:true, size:10000, autoIndexId:true } )
      { "ok" : 1 }
      > db.c.getIndexes()
      [
      	{
      		"v" : 1,
      		"key" : {
      			"_id" : 1
      		},
      		"ns" : "test.c",
      		"name" : "_id_"
      	}
      ]
      > db.c.find( { _id:0, a:0 } ).itcount() // Causes the warning to be logged.
      0
      

            Assignee:
            aaron Aaron Staple
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: