optd icon indicating copy to clipboard operation
optd copied to clipboard

[WIP] Projection Push Down Join, Projection Remove, and Projection Agg Transpose Rules

Open Sweetsuro opened this issue 9 months ago • 0 comments

DO NOT MERGE. This PR implements the remainder of the projection transpose series of rules.

List of Necessary Fixes Prior to Merge

  • [ ] Projection Push Down Join Rule can still apply on the top-level proj -> join, even if it's just generating redundant projection nodes beneath the join node. Need to find a way to avoid applying the rule in cascade's core logic (and in heuristic code path).
  • [ ] Join enumeration is not possible with cyclic memo nodes. Need to implement a better join enumeration algorithm that is not brute forcing through everything in the memo table.
  • [ ] Need a way to match on Scan nodes. Currently, ProjectRemoveRule is only possible in the Heuristic Optimizer pass because of this.
  • [ ] Projection Agg Transpose Rule remains unimplemented.

Projection Push Down Join Rule

  • This rule pushes a projection past a join node. It may still have a top most projection node, and in most cases creates a projection node above the left join child and a projection node above the right join child.
  • This rule is commented out but intended to be a heuristic wrapper rule

Projection Remove Rule

  • This rule matches on a projection node followed by a scan node.
  • It is added in the preliminary heuristic pass

Testing

Unit tests using the dummy heuristic optimizer were implemented.

Sweetsuro avatar May 02 '24 03:05 Sweetsuro