Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring sequential statements execution framework #3070

Open
yixinglu opened this issue Oct 14, 2021 · 0 comments
Open

Refactoring sequential statements execution framework #3070

yixinglu opened this issue Oct 14, 2021 · 0 comments
Labels
priority/med-pri Priority: medium type/enhancement Type: make the code neat or more efficient

Comments

@yixinglu
Copy link
Contributor

yixinglu commented Oct 14, 2021

At present, nebula processes the sequential statements execution as one execution plan and needs to consider some control flow logics when optimizing the plan in optimizer. This will introduce extra complexity either in optimizer or in planner.

We should refactor the implementation of sequential statements, and separate the control flow and data flow into different handle modules in order to support storage procedure later. For example:

$var1 = GO FROM "Tim Duncan" OVER like YIELD like._dst AS dst;
$var2 = GO FROM "Tony Parker" OVER like YIELD like._dst AS dst;
GO FROM $var1.dst, $var2.dst OVER like YIELD $$.player.name;

For above query, we should run two stages optimization for two statements separated by semicolons:

  1. firstly analyze the control flow and do some parallelism optimization, such as:
Before:
  statement1 -> statement2 -> statement3

  => 

After:
  statement1
          \
            ---> statement3 
          /
  statement2

  1. secondly, do some query level optimization as same as the current optimizer implementation.

finally, we will combine the control flow plan and query level plan into one and pass it to scheduler and execution engine to run:

GetNbrs -> Project
               \
                ----> GetNbrs -> Project
               /
GetNbrs -> Project

In the future, we maybe need to support the other control syntax such as for or if, these syntax will only impact the control flow optimization module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/med-pri Priority: medium type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

3 participants