[SERVER-79517] Avoid unnecessary deep copy of ABTs when shredding into the memo Created: 31/Jul/23  Updated: 18/Sep/23  Resolved: 18/Sep/23

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

Type: Improvement Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Backlog - Query Optimization
Resolution: Won't Fix Votes: 0
Labels: M9
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

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.


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