Skip to content

Commit

Permalink
remove EliminateAppendVerticesRule (vesoft-inc#2481)
Browse files Browse the repository at this point in the history
* remove EliminateAppendVerticesRule

* resolve conflicts

---------

Co-authored-by: jie.wang <[email protected]>
  • Loading branch information
nebula-bots and jievince authored Mar 10, 2023
1 parent 99d729b commit b7b9c0f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 47 deletions.
1 change: 0 additions & 1 deletion src/graph/optimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ nebula_add_library(
rule/PushFilterDownAppendVerticesRule.cpp
rule/PushLimitDownTraverseRule.cpp
rule/PushLimitDownAppendVerticesRule.cpp
rule/EliminateAppendVerticesRule.cpp
rule/PushLimitDownScanEdgesRule.cpp
rule/RemoveProjectDedupBeforeGetDstBySrcRule.cpp
rule/PushFilterDownTraverseRule.cpp
Expand Down
11 changes: 6 additions & 5 deletions tests/tck/features/optimizer/EliminateAppendVerticesRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ Feature: Eliminate AppendVertices rule
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
| id | name | dependencies | operator info |
| 5 | Project | 9 | |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |

Scenario: eliminate AppendVertices failed with returned path
When profiling query:
Expand Down
23 changes: 12 additions & 11 deletions tests/tck/features/optimizer/PrunePropertiesRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -401,17 +401,18 @@ Feature: Prune Properties rule
| scount |
| 270 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 12 | Aggregate | 13 | |
| 13 | HashInnerJoin | 15, 11 | |
| 15 | Project | 4 | |
| 4 | Traverse | 3 | { "vertexProps": "" } |
| 3 | Traverse | 14 | { "vertexProps": "" } |
| 14 | IndexScan | 2 | |
| 2 | Start | | |
| 11 | Project | 9 | |
| 9 | Traverse | 8 | { "vertexProps": "" } |
| 8 | Argument | | |
| id | name | dependencies | operator info |
| 12 | Aggregate | 13 | |
| 13 | HashInnerJoin | 15, 11 | |
| 15 | Project | 5 | |
| 5 | AppendVertices | 4 | |
| 4 | Traverse | 3 | { "vertexProps": "" } |
| 3 | Traverse | 14 | { "vertexProps": "" } |
| 14 | IndexScan | 2 | |
| 2 | Start | | |
| 11 | Project | 9 | |
| 9 | Traverse | 8 | { "vertexProps": "" } |
| 8 | Argument | | |

@distonly
Scenario: return function
Expand Down
55 changes: 30 additions & 25 deletions tests/tck/features/optimizer/PushEFilterDownRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ Feature: Push EFilter down rule
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
| id | name | dependencies | operator info |
| 5 | Project | 9 | |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
When profiling query:
"""
MATCH (v:player{name: 'Tim Duncan'})<-[e:like{likeness: 95}]-() return v.player.name AS name
Expand All @@ -33,11 +34,12 @@ Feature: Push EFilter down rule
| name |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
| id | name | dependencies | operator info |
| 5 | Project | 9 | |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
When profiling query:
"""
MATCH (v:player{name: 'Tim Duncan'})-[e:like|serve{likeness: 95}]-() return v.player.name AS name
Expand All @@ -48,11 +50,12 @@ Feature: Push EFilter down rule
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(_any(like.likeness,serve.likeness)==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
| id | name | dependencies | operator info |
| 5 | Project | 9 | |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(_any(like.likeness,serve.likeness)==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
When profiling query:
"""
MATCH (v:player{name: 'Tim Duncan'})-[e:like*1..2{likeness: 95}]->() return v.player.name AS name
Expand All @@ -64,11 +67,12 @@ Feature: Push EFilter down rule
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
| id | name | dependencies | operator info |
| 5 | Project | 9 | |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |

Scenario Outline: can't push eFilter down when zero step enabled
When profiling query:
Expand All @@ -81,8 +85,9 @@ Feature: Push EFilter down rule
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"edge filter": "(*.likeness==95)", "filter": ""} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
| id | name | dependencies | operator info |
| 5 | Project | 9 | |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | {"edge filter": "(*.likeness==95)", "filter": ""} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
11 changes: 6 additions & 5 deletions tests/tck/features/optimizer/PushFilterDownNodeRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ Feature: Push Filter down node rule
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"vertex filter": "", "first step filter": "(player.name==\"Tim Duncan\")"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
| id | name | dependencies | operator info |
| 5 | Project | 9 | |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | {"vertex filter": "", "first step filter": "(player.name==\"Tim Duncan\")"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
When profiling query:
"""
MATCH (v:player{name: 'Tim Duncan'})-[:like]->() WHERE v.player.age == 42 return v.player.name AS name
Expand Down

0 comments on commit b7b9c0f

Please sign in to comment.