Join Optimization: Support single table predicates referencing constant variables

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-113172 implemented functionality to split MatchExpressions into single table residual and equijoin predicates. This function fails if the expression references a variable that is not in the let statement of the $lookup and is not a field path from the local collection.

      This means that expressions like {$expr: {$let: {vars:

      {b: 5}

      , in: {$eq: ['$a', '$$b']}}}} are considered not splittable and thus we bail out of join optimization, even though the expression is a single table predicate and can be pushed down into the find layer.

            Assignee:
            Unassigned
            Reporter:
            Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: