Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-83533

Improve efficiency of SBE when running projections with same prefix

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Execution

      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

        1. explain_plan.js
          217 kB
        2. query.js
          59 kB
        3. SERVER-78878-73.svg
          108 kB

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            c.alonso@mongodb.com Carlos Alonso Pérez
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: