-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
aggregate([
{$group: {_id: "$x", count: {$sum: 1}}},
{$match: {$expr: {$and: [{$eq: ["$_id", 3]}, {$eq: [{$type: "$count"}, "double"]}]}}}
])
The above $expr has a part which can be pushed down past $match.
The existing logic added in SERVER-112772 does consider this predicate permissable for pushdown due to the strict allow-list nature of the check and the presence of the $type expression.
We have code to do $expr splitting and we could allow for this pushdown.
- is related to
-
SERVER-112772 $expr predicates can be incorrectly pushed down before a $group, causing incorrect query results
-
- Closed
-