-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
ALL
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
During query planning, we first tag MatchExpressions with compatible indexes. Then, we use these tags to enumerate physical plans, at which point we build index bounds for the index scan nodes.
There are some incomplete index compatibility checks in the MatchExpression tagging code for $not, resulting in some index tags that are not accurate. We detect this later, during index bounds building, and fail the query with a tassert. Instead, these predicates should not be tagged with the index from the start.
The index compatibility checks in the MatchExpression tagging code for $not are fragile. We should attempt to robustify in this ticket.
See the comments in the linked ticket for more details.