-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
During JOO predicate inference, propagateSingleTablePredicate creates a fresh non-cloned ExpressionContext (carrying only ns and opCtx) and replaces targetNode.accessPath with a new CQ built using this new ExpCtx. All other fields from the original ExpCtx such as collator, explain mode, etc. are lost.
If this node gets selected as reordered.baseNode, SBE lowers using this stripped ExpCtx. For example, expCtx.getCollatorShared() would return null, effectively ignoring collation in SBE. We should investigate whether this is actually an issue and also audit the other fields used in SBE.
The fix is to clone the original ExpCtx via makeCopyFromExpressionContext (perhaps we can re-use the one that stores the PathArrayness information). We would also need to explicitly set inLookup to false on the clone. Foreign node ExpCtx}}s have inLookup=true (set in {{DocumentSourceLookup constructor), which disables CQ simplification.
- blocks
-
SERVER-127530 Join optimization testing: test spill-to-disk
-
- Blocked
-
- related to
-
SERVER-133286 Investige and codify ExpCtx handling in JOO
-
- Needs Scheduling
-