pingcap / pingcap/tidb

Cascades phase II: refactor physical optimization portal to accomandate group based tree

Open
#62,328 0 comments 0 reactions 0 assignees View on GitHub
planner/cascades sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
in cascades implentation:
* **Phase I** is trying to introduce memo among logical optimization and physical optimization, shaped as a logical extension and searching framework, finding more suitable alternatives, then feed original physical code base (single tree based physicalization), which could be seen as a quick applicable verification of cascades.
* **Phase II** is based on work of **Phase I**, which is trying to refactor current physical optimization to be a group based physicalization framework. Several points should be emphasized, it's not so simple as just change the received parameter but we should remove all assumption that current optimizing object is a single tree.
* **the operator is commonly shared (which means you couldn't simple change fields inside anymore)**

* **the children field for iterating down is not dependable anymore, group based tree has its child Group instead, which is accommodating a list of alternative children theoretically.**

* **we can not depend on subtree to do the push check, like subtree.CanPushToCop(kv.tiflash), in current physical optimizing obj level, what you can get is only about current level's operator itself. Child concept is actually generic, don't depend on too much detail on them. For signal passing, use physical prop mechanism instead.**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.