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

Extend support for moving predicates into contained ORs to multikey indexes

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.4
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query 2017-02-13, Query 2017-03-06

      Description

      SERVER-13732 entails moving a predicate into a contained OR to tighten index bounds, i.e. if we have indexes {b: 1, a: 1} and {c: 1, a: 1}, the query

      db.coll.find({$and: [{a: 2}, {$or: [{b: 3}, {c: 4}]}]})
      

      should have the plan

      OR (
      IXSCAN {b:[[3, 3]],a:[[2, 2]]}
      IXSCAN {c:[[4, 4]],a:[[2, 2]]}
      )
      

      This ticket requires the above plan to be generated even if the index is multikey.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tess.avitabile Tess Avitabile
              Reporter:
              tess.avitabile Tess Avitabile
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: