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

Allow $or predicates to be indexed by partial indexes

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.5
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • Quint Iteration 3.1.2, Quint Iteration 3, Quint Iteration 4, Quint Iteration 5

      The 3.1.1 version of partial indexes decides if a given query is compatible with a given partial index by checking if the query's root predicate describes a subset of the documents that the partial index document filter describes. However, this does not allow $or predicates to be indexed by partial indexes, as $or predicates are indexed by a union of scans on separate indexes.

      This would allow the following query to be answerable by a union of scans on the following two indexes:

      • query: find({$or: [{a: 1, f: true}, {b: 1}]})
      • index #1: key pattern {a: 1}, partial index document filter {f: true}
      • index #2: key pattern {b: 1}

            Assignee:
            rassi J Rassi
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: