Skip to content

interpreter planner refactor #4739

@SeaRise

Description

@SeaRise

Enhancement

background

Currently tiflash's interpreter is designed based on DAGQueryBlock.
DAGQueryBlock is designed to coprocess read, and it can handle simple queries well.
However, there is no way to handle the complex query of MPP, so the DAGQueryBlock tree is introduced, which is a compromise that makes the code more complicated and affects the subsequent iterative development.
We need to refactor the interpreter code in a plan visit way.

design

Therefore we introduce a new abstraction layer called PhysicalPlan to replace DAGQueryBlock.
It will be responsible for the processing of ExpressionAction and the generation of BlockInputStream.
We call this organization of code the planner.

DAGRequest (executor tree or executor array).
     |
     |
     v
physical plan <---+
     |            |
     |            | optimize
     |            |
     +------------+   
     |
     |
     v
BlockInputStream

why planner

Most databases are designed based on planner.

  • Friendly for database developers to understand code.
  • We can improve tiflash with a general approach from the DB area, such as pipeline mode.

todo list

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions