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

Query optimizer doesn't use hashed key in a query with sorting on a different indexed value

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.0-rc0
    • Component/s: Querying
    • None
    • ALL

      Hi,

      if I execute a query like this:

      db.entries.find(

      {"u.$id":ObjectId("5124aa20dfee8fb462469370")}

      ).sort({_id:1})

      leads to a full table scan, because he don't use my hashed index on "u.$id".
      If I execute with .hint("u.$id_hashed") it works like expected.

      See discussion here: https://groups.google.com/d/topic/mongodb-user/ngxI9vkv8Y4/discussion

            Assignee:
            Unassigned Unassigned
            Reporter:
            tecbot Thomas Adam
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: