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

Expand a compound wildcard index always for queries on regular fields

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • QE 2023-04-03
    • 135

      There is a false assumption that there's no need to expand a CWI if its wildcard component has been expanded to some specific field.

      Imagine we have a $or query: { $or: [\{a: {$gt: 10}}, \{"sub.a": {$gt: 5}}]} and a CWI {a: 1, "sub.$**": 1}.  The current expanding logic only expands the CWI to an IndexEntry with {a: 1, "sub.a": 1} because "sub.a" is relevant to this CWI. However, the first predicate of the $or - {a: {$gt: 10}} should actually be answered by an expanded IndexEnty w/o specific expanded field, because these two expanded IndexEntrys generate IndexBounds.

            Assignee:
            ruoxin.xu@mongodb.com Ruoxin Xu
            Reporter:
            ruoxin.xu@mongodb.com Ruoxin Xu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: