Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
-
Query Optimization
Description
I'm thinking of a query like so:
db.foo.aggregate([{$replaceWith: "$x"}, {$match: {y: 1}}, {$project: {y: 1}}]) |
SERVER-72037 describes the work to push the $match before the $replaceWith. But even if that is complete, we would seem to stop our projection/dependency analysis at the $replaceWith stage there and miss that the query only needs "x.y", not all of "x". If "x" had many sub-fields, this could be a dramatic savings.
Attachments
Issue Links
- is related to
-
SERVER-72037 Allow $replace(With|Root) to participate more in $match optimizations
-
- Open
-