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

Investigate using linear builder-style compilation of EExpression

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • QE 2023-05-15, QE 2023-05-29, QE 2023-06-12, QE 2023-06-26, QE 2023-07-10
    • 10

      Current compilation of EExpression that relies on following pattern:

       

      vm::CodeFragment compileDirect(CompileCtx& ctx) {
        vm::CodeFragment code;
        code.append ...
        return code;
      }

      this results in O(N*D) complexity, where N is size of expression and D is depth of tree.

       

      Instead, use linear compilation that uses the following pattern:

      struct CompileCtx {
          vm::CodeFragment* code;
      }; 
      
      void compileDirect(CompileCtx& ctx) {
       ctx.code->append ...
      }

      in most cases to achieve O(N).

      In complex cases, the compileDirect may still allowed to use separate vm::CodeFragments if needed.

       

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            anna.wawrzyniak@mongodb.com Anna Wawrzyniak
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: