-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
If we know that a field path is not an array then in the boolean simplifer we can apply the following transformations:
{a: {$lt: 1} } -> {a: {$not: {$gte: 1} } }
{a: {$lte: 1} } -> {a: {$not: {$gt: 1} } }
This reduces the number of unique predicates and enables simplifications such as in the following example (courtesy of alexander.ignatyev@mongodb.com:
"a > 10 and a <= 10 without the transformation this is 2 different predicates: A and B, with the transformation it will be A and not A which is always false"