• Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: Performance
    • None

      > db.people.distinct('city',

      {state:'NY'}

      ).length
      1371
      > Date.timeFunc(function(){db.people.distinct('city',

      {state:'NY'}

      )})
      14369
      > db.people.find(

      {state:'NY'}

      ).explain().millis
      1338

      db.people.find(

      {state:'NY'}

      ).explain()
      {
      "cursor" : "BtreeCursor state_1_city_1",
      "indexBounds" : [
      [
      {
      "state" : "NY",
      "city" :

      { "$minElement" : 1 }

      },
      {
      "state" : "NY",
      "city" :

      { "$maxElement" : 1 }

      }
      ]
      ],
      "nscanned" : 1980644,
      "nscannedObjects" : 1980644,
      "n" : 1980644,
      "millis" : 1365,
      "oldPlan" : {
      "cursor" : "BtreeCursor state_1_city_1",
      "indexBounds" : [
      [
      {
      "state" : "NY",
      "city" :

      { "$minElement" : 1 }

      },
      {
      "state" : "NY",
      "city" :

      { "$maxElement" : 1 }

      }
      ]
      ]
      },
      "allPlans" : [
      {
      "cursor" : "BtreeCursor state_1_city_1",
      "indexBounds" : [
      [
      {
      "state" : "NY",
      "city" :

      { "$minElement" : 1 }

      },
      {
      "state" : "NY",
      "city" :

      { "$maxElement" : 1 }

      }
      ]
      ]
      }
      ]
      }

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: