-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Aggregation pipeline's get_executor relies currently on collection's pointers stored in MultipleCollectionAccessor. The class stores collection info for the main collection and for the foreign collections. In case of $lookup with subpipelines we don't push down to CanonicalQuery and, therefore, don't add its foreign namespace to the list of foreign namespaces of the pipeline.
This approach does not work with join plans where we create a CanonicalQuery for every collection participating in the join graph even its corresponding $lookup contains a subpipeline.
One possible solution could be just remove if (getSubPipelines().empty()) condition and always add lookup's foreign namespaces. However, it can have a potential negative performance impact.
Another solution is to use `getInvolvedNamespaces()` to build MultipleCollectionAccessor.
The third solution is to build MultipleCollectionAccessor for every CanonicalQuery in the join graph.
- is duplicated by
-
SERVER-112607 Bail out of join optimizer if subpipeline contains non-match stage
-
- Closed
-
- is related to
-
SERVER-110839 Integrate join optimization into pipeline optimization
-
- Closed
-
-
SERVER-112607 Bail out of join optimizer if subpipeline contains non-match stage
-
- Closed
-