[SERVER-47664] Improved MatchExpression equivalence checking Created: 20/Apr/20  Updated: 28/Nov/23

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Bernard Gorman Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-79514 Make value comparison consistent in M... Closed
is related to SERVER-47661 Ensure consistent sort-order for Matc... Backlog
Assigned Teams:
Query Execution
Participants:

 Description   

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.


Generated at Thu Feb 08 05:14:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.