[SERVER-37961] IndexBoundsBuilder::translateEquality never needs to sort the entire output Created: 06/Nov/18 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jacob Evans | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Backwards Compatibility: | Fully Compatible |
| Participants: | |
| Case: | (copied to CRM) |
| Description |
|
In the case an array element added to an interval list, the code sorts the entire output interval list. This sort is redundant for $in since a sort will eventually be done as part of unionize. translateEquality only needs to be concerned with the two elements it is adding and should just place them on the end of the list in order. If it does so it will also be correct for $eq since the two elements will be the only ones in the output list. |
| Comments |
| Comment by Asya Kamsky [ 09/Nov/18 ] |
|
Not aware of such. |
| Comment by Ian Whalen (Inactive) [ 09/Nov/18 ] |
|
asya are you aware of any use cases where users run large $in queries where the in values are arrays. |