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

explain doesn't include index name on geo queries

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Geo, Index Maintenance
    • Labels:
      None

      > db.system.indexes.find()
      { "v" : 1, "key" :

      { "_id" : 1 }

      , "ns" : "test.system.users", "name" : "id" }
      { "v" : 1, "key" :

      { "_id" : 1 }

      , "ns" : "test.foo", "name" : "id" }
      { "v" : 1, "key" :

      { "a" : 1, "b" : 1 }

      , "ns" : "test.foo", "name" : "a_1_b_1" }
      { "v" : 1, "key" :

      { "b" : 1 }

      , "ns" : "test.foo", "name" : "b_1" }
      { "v" : 1, "key" :

      { "l" : "2d", "a" : 1 }

      , "ns" : "test.foo", "name" : "l__a_1" }
      { "v" : 1, "key" :

      { "l" : "2d", "b" : 2 }

      , "ns" : "test.foo", "name" : "l__b_2" }

      > db.foo.find({l:{$near:[55,55]},b:1}).explain()
      {
      "cursor" : "GeoSearchCursor",
      "nscanned" : 0,
      "nscannedObjects" : 0,
      "n" : 0,
      "millis" : 0,
      "nYields" : 0,
      "nChunkSkips" : 0,
      "isMultiKey" : false,
      "indexOnly" : false,
      "indexBounds" : {

      }
      }

      Note that it just says "GeoSearchCursor", without the name of the cursor. Unlike a query on a normal btree cursor, which includes the cursor name as well as the type:

      > db.foo.find(

      {a:1}

      ).explain()
      {
      "cursor" : "BtreeCursor a_1_b_1",
      "nscanned" : 1,
      "nscannedObjects" : 1,
      "n" : 1,
      "millis" : 0,
      "nYields" : 0,
      "nChunkSkips" : 0,
      "isMultiKey" : false,
      "indexOnly" : false,
      "indexBounds" : {
      "a" : [
      [
      1,
      1
      ]
      ],
      "b" : [
      [

      { "$minElement" : 1 }

      ,

      { "$maxElement" : 1 }

      ]
      ]
      }
      }

            Assignee:
            Unassigned Unassigned
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: