Allow $or predicates to be indexed by partial indexes

XMLWordPrintableJSON

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

      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:
              J Rassi (Inactive)
              Reporter:
              J Rassi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: