Skip to content

Commit

Permalink
Log query for opt error
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed Dec 8, 2022
1 parent a5dfbd1 commit 22e3ff9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/graph/service/QueryInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ Status QueryInstance::validateAndOptimize() {
// Optimize the query, and get the execution plan. We should not pass the optimizer errors to user
// since the message is often not easy to understand. Logging them is enough.
if (auto status = findBestPlan(); !status.ok()) {
LOG(ERROR) << "Error found in optimization stage: " << status.message();
LOG(ERROR) << "Error found in optimization stage for query: " << rctx->query()
<< ", error: " << status.message();
return Status::Error(
"There are some errors found in optimizer, "
"please contact to the admin to learn more details");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,20 @@ Feature: Push Filter down HashInnerJoin rule
| a | b | c |
| ("Amar'e Stoudemire" :player{age: 36, name: "Amar'e Stoudemire"}) | ("Steve Nash" :player{age: 45, name: "Steve Nash"}) | ("Lakers" :team{name: "Lakers"}) |
And the execution plan should be:
| id | name | dependencies | operator info |
| 16 | TopN | 25 | |
| 25 | HashInnerJoin | 27,29 | |
| 27 | Project | 30 | |
| id | name | dependencies | operator info |
| 16 | TopN | 25 | |
| 25 | HashInnerJoin | 27,29 | |
| 27 | Project | 30 | |
| 30 | Filter | 4 | {"condition": "((($-.b.player.age+$-.a.player.age)>40) AND ($-.a.player.age<45) AND ($-.b.player.age>30))"} |
| 4 | AppendVertices | 24 | |
| 24 | Traverse | 1 | |
| 1 | IndexScan | 2 | |
| 2 | Start | | |
| 29 | Project | 28 | |
| 28 | Filter | 9 | {"condition": "($-.c.team.name>\"A\")"} |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | |
| 7 | Argument | | |
| 4 | AppendVertices | 24 | |
| 24 | Traverse | 1 | |
| 1 | IndexScan | 2 | |
| 2 | Start | | |
| 29 | Project | 28 | |
| 28 | Filter | 9 | {"condition": "($-.c.team.name>\"A\")"} |
| 9 | AppendVertices | 8 | |
| 8 | Traverse | 7 | |
| 7 | Argument | | |
When profiling query:
"""
match (a:player)-[:like]->(b)
Expand Down

0 comments on commit 22e3ff9

Please sign in to comment.