[SERVER-27658] $or should choose SORT_MERGE instead of OR if all children provide the same sort Created: 12/Jan/17 Updated: 06/Dec/22 Resolved: 24/Jan/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Tess Avitabile (Inactive) | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Participants: | |||||||||
| Description |
|
We only choose a SORT_MERGE stage to combine or-clauses if there is a sort requested and all children can provide the sort. However, we could use a SORT_MERGE stage if all children provide the same sort, even if it is not the sort requested, or there is no sort requested. We look for a sort shared by all children here. This suggested improvement is assuming that a SORT_MERGE stage is always better than an OR stage in terms of performance or memory usage. |
| Comments |
| Comment by David Storch [ 24/Jan/17 ] |
|
Closing as a duplicate of SERVER-24518. |