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

$in with sort doesnt use index

      Query

      I have index on
      db.ogloszenia2.ensureIndex(

      {id:1, x:-1}

      );

      db.ogloszenia2.find({"id":397).limit(200).sort({"x":-1); //use index
      db.ogloszenia2.find({"id":422).limit(200).sort({"x":-1); //use index
      db.ogloszenia2.find({"id":{$in:[397,422]}).limit(200); //use index

      db.ogloszenia2.find({"id":{$in:[397,422]}).limit(200).sort({"x":-1); //does not use index

            Assignee:
            Unassigned Unassigned
            Reporter:
            ppalka@gratka-technologie.pl ppalka
            Votes:
            11 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: