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

_id query on capped collection warning can be printed incorrectly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.6, 2.1.1
    • Component/s: Querying
    • Labels:
      None
    • Operating System:
      ALL

      Description

      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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: