-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
Query Execution
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Our current MatchExpression:equivalent comparison is deficient in a number of ways. It intentionally performs a simple, direct comparison between trees that does not attempt to account for predicate order or other similar differences, but can fail to identify equivalent trees even in cases where both have been optimized and sorted. SERVER-47661 is intended to address the latter, but we should make further efforts to improvement MatchExpression equivalence checking where possible.
For instance, we require that the collators of both trees match when checking the equivalence of comparison predicates, but then neglect to take collation into account when checking whether string predicates are equivalent. Under a case-insensitive collation, for example, a predicate {a:"blah"} would match the same set of documents as {a:"BLAH"}, and so these should be considered equivalent. Currently, however, the predicates are are always evaluated using simple binary comparison, and so these two predicates will always be considered different from each other.
- is related to
-
SERVER-47661 Ensure consistent sort-order for MatchExpression trees
-
- Backlog
-
- related to
-
SERVER-79514 Make value comparison consistent in MatchExpression
-
- Closed
-