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

Refactor go planner #5369

Merged
merged 30 commits into from
Mar 13, 2023
Merged

Conversation

nevermore3
Copy link
Contributor

@nevermore3 nevermore3 commented Feb 24, 2023

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

close https://github.com/vesoft-inc/nebula-ent/issues/2532

Description:

yield 'Tim Duncan' as a | go 3 steps from $-.a over like where like.likeness > 30 yield edge as e

previous plan

image

current plan
image

Due to the existence of the loop operator in the previous plan, the data flow and dependencies were inconsistent, so many optimization rules could not be applied, such as filter pushdown, merging projects, and so on.

in the new plan. the go statement is divided into two operators, expand and expandall, expand is responsible for expansion, and expandAll is responsible for the expansion process to obtain the attributes required by the user

BEFORE:

(root@nebula) [nba]> yield 'Tim Duncan' AS id| go 100 steps from $-.id  over * bidirect yield edge as e|yield count(*)
+----------+
| count(*) |
+----------+
| 486      |
+----------+
Got 1 rows (time spent 3178857/3188150 us)

NOW:

(root@nebula) [nba]> yield 'Tim Duncan' AS id| go 100 steps from $-.id  over * bidirect yield edge as e|yield count(*)
+----------+
| count(*) |
+----------+
| 486      |
+----------+
Got 1 rows (time spent 209215/209876 us)

image

the yellow line is the optimized version
the blue line is the master version

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@nevermore3 nevermore3 force-pushed the refactor_go_planner branch 25 times, most recently from f2d7c25 to 51b4346 Compare March 2, 2023 08:45
@nevermore3 nevermore3 marked this pull request as ready for review March 2, 2023 09:21
@nevermore3 nevermore3 force-pushed the refactor_go_planner branch 4 times, most recently from 403a8cf to df5a329 Compare March 7, 2023 06:14
@nevermore3 nevermore3 force-pushed the refactor_go_planner branch from 85c8c0a to facb3a9 Compare March 13, 2023 03:26
@yixinglu yixinglu requested a review from jievince March 13, 2023 06:40
@Sophie-Xie Sophie-Xie merged commit e3e6916 into vesoft-inc:master Mar 13, 2023
@Sophie-Xie Sophie-Xie added the doc affected PR: improvements or additions to documentation label Mar 13, 2023
@nevermore3 nevermore3 deleted the refactor_go_planner branch March 16, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc affected PR: improvements or additions to documentation incompatible PR: incompatible with the recently released version ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants