[SERVER-83533] Improve efficiency of SBE when running projections with same prefix Created: 22/Nov/23  Updated: 24/Nov/23  Resolved: 24/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Carlos Alonso Pérez Assignee: Backlog - Query Execution
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File SERVER-78878-73.svg     File explain_plan.js     File query.js    
Issue Links:
Duplicate
duplicates SERVER-79548 [SBE] optimize pulling multiple field... Open
Assigned Teams:
Query Execution
Participants:

 Description   

In SBE projections are isolated but there are cases where there are many projections sharing the same prefix e.g:

 

$project: {
     "d" : "a.b.c.d",
     "e" : "a.b.c.e",
     "f" : "a.b.c.f",
     "g" : "a.b.c.g",
     "h" : "a.b.c.h",
}

In the above example all the work to navigate up until c is repeated and thrown away on every projected field.

 

See the attached flame graph, query and explain plan for a real life example derived from HELP-47436


Generated at Thu Feb 08 06:52:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.