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

Small DocumentSourceMatch and DocumentSourceLookup refactors

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

      Some ideas that came out of SERVER-99121 to improve DocumentSourceMatch and DocumentSourceLookup:

      • Currently, DocumentSourceLookup::_matchSrc is a pointer to any DocumentSourceMatch(s) that the $lookup was able to absorb during the LUM ($lookup, $unwind, $match) rewrite. It would make more sense for _matchSrc to directly be a pointer to the MatchExpression instead, since we only use _matchSrc to generate the additional filter for the lookup. Note that to do this we would need to add a function that releases the MatchExpression/backing BSON from the DocumentSourceMatch in the pipeline, as described here.
      • Since _matchSrc is now a MatchExpression, and the main contents of DocumentSourceMatch::joinMatchWith operate over MatchExpressions (as of SERVER-99121), we could pull out the work currently done in the addPredicates lambda and either put it in expression_algo.h or make it a function of the MatchExpression class.
      • Similarly, DocumentSourceMatch::descendMatchOnPath is only used in this LUM rewrite and operates over the input MatchExpression. It would make more sense to either put it in expression_algo.h or make it a function of the MatchExpression class.

            Assignee:
            Unassigned Unassigned
            Reporter:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None