[SERVER-68429] Investigate eliminating repeated path traversals in SBE Created: 29/Jul/22 Updated: 27/Mar/23 |
|
| Status: | Open |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Mihai Andrei | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||
| Participants: | |||||||||||||
| Story Points: | 15 | ||||||||||||
| Description |
|
One of the areas in which SBE's performance can be improved is by eliminating repeated path traversals. This is evident in $or queries such as:
The SBE plan is as follows:
In the above plan, we perform multiple getField lookups for "a" and "b", one for each branch of the $or. This ticket tracks to investigate eliminating such repeated path lookups when constructing SBE plans (credit to nikita.lapkov@mongodb.com for the idea!) |
| Comments |
| Comment by David Storch [ 27/Mar/23 ] |
|
We have a few benchmarks for scenarios where there are repeated path traversals that could theoretically be optimized by this ticket:
Even without the optimization, SBE already shows a substantial speedup compared to the Classic Engine for these benchmarks. The data shows reductions in latency of 20% or more for SBE vs. Classic. |
| Comment by Kyle Suarez [ 26/Sep/22 ] |
|
Thanks nikita.lapkov@mongodb.com, I also linked |
| Comment by Nikita Lapkov (Inactive) [ 23/Sep/22 ] |
|
kyle.suarez@mongodb.com Agreed, this could definitely be an area where ABT might help. Also I noticed that the plan is using a lot of stages, so we should reevaluate the performance impact after I linked this ticket to |
| Comment by Kyle Suarez [ 21/Sep/22 ] |
|
mihai.andrei@mongodb.com, could you make sure we have a benchmark that targets this case? If it turns out there's a regression we need to fix this might need to move back from M4 to M2. |
| Comment by Kyle Suarez [ 21/Sep/22 ] |
|
nikita.lapkov@mongodb.com's work in |