[SERVER-78878] Avoid adding a project before a group when there are too many group dependencies. Created: 11/Jul/23 Updated: 27/Nov/23 Resolved: 27/Nov/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mickey Winters | Assignee: | Carlos Alonso Pérez |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Sprint: | QO 2023-11-27, QO 2023-12-11 |
| Participants: |
| Description |
|
in certain cases when in the classic engine the rewrite that adds a project before a group is more expensive to evaluate then it is worth. perhaps we should not apply this optimization when we have more than N fields to project before the group. We noticed this when comparing 4.2 to 4.4 |
| Comments |
| Comment by Mickey Winters [ 27/Nov/23 ] |
|
When I originally opened this I thought the heuristic of if there are more than X fields in the group key then it is probably projecting the whole document. but even with the case of the customer that prompted me to open this there could be a situation like 400/700 fields projected so I doubt there is a safe value of X now. Realistically we might need statistics to figure out what X is, but bonsai is cost based and is already planned to determine if a project stage is actually worth it in this situation so no extra work is needed. |