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

$graphLookup does not report variable references for 'restrictSearchWithMatch' filter

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.23, 4.4.17, 5.0.13, 6.0.2
    • Affects Version/s: 6.0.0-rc13
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.0, v4.4, v4.2
    • QO 2022-09-05

      As part of $lookup sub-pipeline correlation analysis, we try to detect the largest prefix of the pipeline which is non-correlated and temporarily cache the result instead of re-running for each document in the outer pipeline. This optimization relies on each aggregation stage correctly reporting it's variable dependencies, which may include a variable defined in the 'let' of the $lookup.

      However $graphLookup does not fully report its dependencies for the 'restrictSearchWithMatch' option, which means if its contained in a $lookup sub-pipeline then it may be incorrectly treated as non-correlated.

            Assignee:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: