-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
Investigate if we can always move $match stages ahead of stages that do not modify or rename any paths (getModifiedPaths() == {DocumentSource::GetModPathsReturn::Type::kFiniteSet, {}, {}}) (4 stages) and have canSwapWithMatch == true (15 stages).
Currently, this decision depends on the result of the hasOnlyRenameableMatchExpressionChildren() function which examines the content of a $mach stage and might return false, in which case the $match stage will not be moved. SERVER-73914 decreased the number of such expressions and more expressions are to be addressed with SERVER-55492, however, it is not clear if this is necessary when the modified paths by the previous stage are empty.
If we can always move $match ahead of stages that do not modify any paths, we should remove the workaround introduced by SERVER-91406.
- is related to
-
SERVER-91406 $changeStreamSplitLargeEvent returns Location7182803 error when used with non-renameable match expression
- Closed
-
SERVER-55492 Implement renames for kOther and kArrayMatching MatchExpressions
- Backlog
-
SERVER-73914 Implement renames for kArrayMatching MatchExpressions
- Closed