-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
Fully Compatible
-
QO 2023-10-16, QO 2023-10-30, QO 2023-11-13, QO 2023-11-27
-
200
Irina suggested in this comment that {$in: []} is tautologically "false" so it would be nice to optimize the plan to "return an empty result right away" rather than scanning anything.
- depends on
-
SERVER-81863 Avoid a scan of either IDX or a collection if the filter is $alwaysFalse:
-
- Closed
-
- fixes
-
SERVER-47374 Query with empty in clause performs collection scan
-
- Closed
-
- is related to
-
SERVER-97911 Query with "_id in empty array" traverses the full collection when given the _id index as a hint
-
- Closed
-
-
SERVER-101007 $or followed by always false $elemMatch can fail pipeline optimization
-
- Investigating
-