-
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
Aggregation stages that resolve views (such as $lookup, $unionWith, and $graphLookup) differ in how they serialize and report view information during explain:
- In $lookup, when configured with a user-facing pipeline: [...], the resolved view pipeline is shown as part of the stage's pipeline output in explain. But when using localField/foreignField syntax without a pipeline, the view stages are omitted from explain. On mongos, $lookup rewrites from to the resolved backing namespace for explain.
- In $unionWith, the stage prepares and explains the sub-pipeline during explain, displaying the inner plan or stages.
- In $graphLookup, there is no user-facing pipeline option syntax. View pipelines are resolved and transferred on the wire via the internal field '$_internalFromPipeline', which is suppressed during explain to avoid leaking internal wire protocol fields. As a result, $graphLookup has no mechanism to expose the resolved view pipeline in explain output.
We need to triage and design a consistent approach for:
- Exposing underlying view pipelines in explain output.
- Deciding whether from in explain should display the user-provided view name or the backing collection.
- related to
-
SERVER-134804 Investigate resolved namespace correctness when target is dropped and re-created as a view during sharded query execution
-
- Backlog
-
-
SERVER-134439 Fix $graphLookup $_internalFromPipeline serialization asymmetry
-
- Closed
-