-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Minor optimize for go n steps #4566
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fd8f632
Minor fixes and improvements
jievince 3c06643
fix ctest
jievince 98bdd27
fix rewriteVertexEdge2EdgeProp
jievince 4291c68
fix fix
jievince e1db26a
Merge branch 'master' into opt-n-steps
jievince c39f5e9
Merge branch 'master' into opt-n-steps
jievince File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ Feature: Simple case | |
| 1 | GetDstBySrc | 0 | | | ||
| 0 | Start | | | | ||
|
||
Scenario: go m steps yield distinct dst id | ||
Scenario: go m steps | ||
When profiling query: | ||
""" | ||
GO 3 STEPS FROM "Tony Parker" OVER serve BIDIRECT YIELD DISTINCT id($$) AS dst | YIELD count(*) | ||
|
@@ -39,6 +39,89 @@ Feature: Simple case | |
| 2 | GetDstBySrc | 1 | | | ||
| 1 | Start | | | | ||
| 0 | Start | | | | ||
# The last step degenerates to `GetNeighbors` when yield or filter properties other than `_dst` | ||
When profiling query: | ||
""" | ||
GO 3 STEPS FROM "Tony Parker" OVER serve BIDIRECT YIELD id($$) AS dst | YIELD count(*) | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| count(*) | | ||
| 65 | | ||
And the execution plan should be: | ||
| id | name | dependencies | operator info | | ||
| 7 | Aggregate | 6 | | | ||
| 6 | Project | 5 | | | ||
| 5 | GetNeighbors | 4 | | | ||
| 4 | Loop | 0 | {"loopBody": "3"} | | ||
| 3 | Dedup | 2 | | | ||
| 2 | GetDstBySrc | 1 | | | ||
| 1 | Start | | | | ||
| 0 | Start | | | | ||
When profiling query: | ||
""" | ||
GO 3 STEPS FROM "Tony Parker" OVER serve BIDIRECT YIELD $$.player.age AS age | YIELD count(*) | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| count(*) | | ||
| 65 | | ||
And the execution plan should be: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before:
|
||
| id | name | dependencies | operator info | | ||
| 11 | Aggregate | 10 | | | ||
| 10 | Project | 9 | | | ||
| 9 | LeftJoin | 8 | | | ||
| 8 | Project | 7 | | | ||
| 7 | GetVertices | 6 | | | ||
| 6 | Project | 5 | | | ||
| 5 | GetNeighbors | 4 | | | ||
| 4 | Loop | 0 | {"loopBody": "3"} | | ||
| 3 | Dedup | 2 | | | ||
| 2 | GetDstBySrc | 1 | | | ||
| 1 | Start | | | | ||
| 0 | Start | | | | ||
When profiling query: | ||
""" | ||
GO 3 STEPS FROM "Tony Parker" OVER * WHERE $$.player.age > 36 YIELD $$.player.age AS age | YIELD count(*) | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| count(*) | | ||
| 10 | | ||
And the execution plan should be: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before:
|
||
| id | name | dependencies | operator info | | ||
| 12 | Aggregate | 11 | | | ||
| 11 | Project | 10 | | | ||
| 10 | Filter | 9 | | | ||
| 9 | LeftJoin | 8 | | | ||
| 8 | Project | 7 | | | ||
| 7 | GetVertices | 6 | | | ||
| 6 | Project | 5 | | | ||
| 5 | GetNeighbors | 4 | | | ||
| 4 | Loop | 0 | {"loopBody": "3"} | | ||
| 3 | Dedup | 2 | | | ||
| 2 | GetDstBySrc | 1 | | | ||
| 1 | Start | | | | ||
| 0 | Start | | | | ||
# Because GetDstBySrc doesn't support limit push down, so degenrate to GetNeighbors when the query contains limit/simple clause | ||
When profiling query: | ||
""" | ||
GO 3 STEPS FROM "Tony Parker" OVER * YIELD DISTINCT id($$) LIMIT [100, 100, 100] | YIELD count(*) | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| count(*) | | ||
| 13 | | ||
And the execution plan should be: | ||
| id | name | dependencies | operator info | | ||
| 11 | Aggregate | 10 | | | ||
| 10 | Dedup | 9 | | | ||
| 9 | Project | 12 | | | ||
| 12 | Limit | 13 | | | ||
| 13 | GetNeighbors | 6 | | | ||
| 6 | Loop | 0 | {"loopBody": "5"} | | ||
| 5 | Dedup | 4 | | | ||
| 4 | Project | 14 | | | ||
| 14 | Limit | 15 | | | ||
| 15 | GetNeighbors | 1 | | | ||
| 1 | Start | | | | ||
| 0 | Start | | | | ||
|
||
Scenario: go m to n steps yield distinct dst id | ||
When profiling query: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before: