Bail out of join optimizer if subpipeline contains non-match stage

XMLWordPrintableJSON

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

      Any non match stages like projections or sorts in subpipelines will complicate our analysis in the join optimizer so we should not attempt to reorder such cases for now.

      For example, $lookup Foo, $unwind, $lookup Bar with $sort in subpipline, $unwind. The user may expect a particular order of the Bar documents. This means we cannot consider a plan with does HJ on Bar and then a HJ on Foo as that will not respect the semantics of the query.

      Restricting subpipelines to match will allow us to support compound equijoin predicates.

            Assignee:
            Alya Berciu
            Reporter:
            Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: