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

Avoid unnecessary deep copy of ABTs when shredding into the memo

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization

      After a query is translated to ABT, we go through the process of "shredding" it into groups within the memo. This process involves walking the ABT and making a copy of each sub-tree only to override the child node. Since the ABT's copy constructor is a full deep copy by default, there is a lot of potentially wasted work.

      As an example, for an input ABT such as

      Root
         |
      Filter
         |
      Filter
         |
      Evaluation
         |
      Scan
      

      the code linked above will get called for each node as we walk the ABT, starting with

      Evaluation
         |
      Scan
      

      all the way up to the full Root node, each time making a copy only to replace the child with a delegator node.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: