[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:
Duplicate
duplicates SERVER-24518 MERGE_SORT_STAGE can be used more agg... Backlog
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.

Generated at Thu Feb 08 04:15:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.