Details
-
Improvement
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
None
-
Query Optimization
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.