-
Type: Improvement
-
Resolution: Gone away
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
A few definitions of operator<=> exist in the codebase.
There are a few problems with their definitions and their usage.
As written, they provide no benefit over the old comparison operators, and are less performant. They should be made idiomatic, efficient, and correct or perhaps removed. The concern is that they will be copied and the flaws would propagate.
- https://github.com/10gen/mongo/blob/master/src/mongo/db/query/index_hint.cpp#L172
- This one is not wrong but it is used to create an inefficient operator==, and should not be.
- https://github.com/10gen/mongo/blob/master/src/mongo/db/query/index_hint.h#L62
- This one is fine. It's defaulted.
- There should be a default operator== with it though.
- https://github.com/10gen/mongo/blob/master/src/mongo/db/query/record_id_bound.h#L85
- ok, but should not be used to create an operator==.
- https://github.com/10gen/mongo/blob/master/src/mongo/db/record_id.h#L312
- ok, but should not be used to create an operator==.
- https://github.com/10gen/mongo/blob/master/src/mongo/util/tracked_types.h#L123
- The return type of bool is incorrect.
- Doesn't need to exist, as this type redundantly defines the other relational operators (<, >, <=, >=). We can fix this one and remove those operators or just remove the <=>.
- https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/index_hint.cpp#L52
- Strong ordering doing double work (both < and >). This is used to implement IndexHint equality inefficiently.
- split to
-
SERVER-90265 Fix spaceship operator return type and redundancy in unique_tracked_ptr
- Closed
-
SERVER-90300 Improve implementations of == alongside existing <=> implementations
- Backlog
-
SERVER-90349 Remove superfluous semicolons at the end of namespaces in query source code.
- Backlog
-
SERVER-90298 Fix compare implementation for IndexName to only do string comparison once
- Closed