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

Consider index for range+equality style queries

      Currently you can hint to use an index for range+equlity matches but the index will not be considered otherwise. I would like to see it be considered like any other potential index.

      Example of desired behavior:

      db.coll.insert({a:twoDaysAgoDate, b:2})
      ... // millions of docs where a is less than 2 days ago
      db.coll.ensureIndex({a:1,b:1})
      db.coll.find({a:{$gt:oneDayAgoDate}, b:2}) //uses index, doesn't now.
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: