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

Allow distinct to use indexes

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.3
    • Affects Version/s: 1.6.1
    • Component/s: Index Maintenance, Querying
    • None

      db.ensureIndex(

      {x:1}

      )

      db.distinct('x')

      Distinct apparently does a full table scan, even though it could use the index to speed things up a bit. Please see the discussion here:

      http://groups.google.com/group/mongodb-user/browse_thread/thread/912fd4b9e303fb04/

      My current application of MongoDB relies on fast distincts, and I think this would help quite a bit.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            kevin1024 Kevin McCarthy
            Votes:
            9 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: