-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: 8.0.9
-
Component/s: Query Planning
-
Query Optimization
-
Fully Compatible
-
v8.2, v8.1, v8.0
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
If an aggregate includes a $lookup on a view using a pipeline with a $match that can be partially supported by an index, and the pipeline uses constants, it is executed in a few milliseconds and using a single index scan on the base collection of the view.
If the pipeline uses locally defined variables, still assigned to the same constants, the generated plan does a full collection scan, ignoring the predicate
See attached repro case
- related to
-
SERVER-112772 $expr predicates can be incorrectly pushed down before a $group, causing incorrect query results
-
- In Progress
-
-
SERVER-107435 Implement setParameter to disable $sequentialCache
-
- Backlog
-
-
SERVER-41252 Enable covered query for $expr with $eq only
-
- In Code Review
-
-
SERVER-107066 $expr equality predicate on a constant projected column defeats match pushdown optimization
-
- Closed
-
-
SERVER-113935 Write a targeted PBT to test $expr splitting optimization
-
- Needs Scheduling
-