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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 2.4.0-rc0
    • None
    • Querying
    • None
    • ALL

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: