-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: Add ability to Explain the response plan. #385
Conversation
5ea6914
to
e858e5e
Compare
e858e5e
to
88857c0
Compare
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.
Few thoughts, some just suggestions or comments. One notable structural change on the planNode interface.
0a295ed
to
d1101e1
Compare
bb8fdb7
to
c5656b0
Compare
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.
Partial review - will continue later
…e`, and the `scanNode` with their attributes.
todo: Still have to implement their children.
ed129d3
to
a2cb0fd
Compare
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.
Looks great! Everying has mostly been taken care of.
Omitting my comments about the multiscanNode stuff since we discussed that on discord. (TLDR: multiscanNode embedding *scanNode
caused issue :/)
Only notable issue is the assumed allocation of map[string]interface{}
in Explain()
methods. Basically, if a node is explainable, but doens't care to emit attributes, it should be fine to return a nil
map. But currently, that will crash the DB since it assumes it returns a non-nil map.
tests/integration/mutation/simple/create/explain_simple_create_test.go
Outdated
Show resolved
Hide resolved
plan node and be non-explainable.
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.
LGTM
- RELATED ISSUES: Resolves sourcenetwork#325, Closes sourcenetwork#361, Closes sourcenetwork#362 and also Closes sourcenetwork#363 (Closing the `TEXT` structured ones because we have decided to only go with JSON approach to avoid the wonky looking client side formatting). Fixes sourcenetwork#486 in commit [d940f7b](sourcenetwork@d940f7b) - DESCRIPTION: This PR lays all the ground work needed to have the opt-ability for planner nodes to subscribe to the explain interface if they would like to be exposed to the explaining of the plan graph. Even though top-level plan **node** name will be explained after this PR for all explainable nodes, this PR doesn't implement all the explain attributes for all explainable nodes. Here are the planNodes whose attributes can be explained after this PR: 1) `selectNode` (attributes completed) 2) `selectTopNode` (attributes completed / has no attributes) 3) `createNode` (attributes completed) 4) `deleteNode` (attributes completed) 5) `scanNode` (some attributes completed) Request: ``` query @Explain { user { _key age name } } ``` Response: ``` { "data": [ { "explain": { "selectTopNode": { "selectNode": { "filter": null, "scanNode": { "collectionID": "1", "collectionName": "user", "filter": null } } } } } ] } ```
Related Issues
Resolves #325,
Resolved #477 (as
CommitSelectNode
for now doesn't have any explainable attribute)Closes #361, Closes #362 and also Closes #363 (Closing the
TEXT
structured ones because we have decided to only go with JSON approach to avoid the wonky looking client side formatting).Fixes #486 in commit d940f7b2e6ee54d0ce8b4bd8f5330db60307630f
Description
This PR lays all the ground work needed to have the opt-ability for planner nodes to subscribe to the explain interface if they would like to be exposed to the explaining of the plan graph.
Even though top-level plan node name will be explained after this PR for all explainable nodes, this PR doesn't implement all the explain attributes for all explainable nodes. Here are the planNodes whose attributes can be explained after this PR:
selectNode
(attributes completed)selectTopNode
(attributes completed / has no attributes)createNode
(attributes completed)deleteNode
(attributes completed)scanNode
(some attributes completed)Request:
Response:
The other attributes that need to be added are now tracked as sub-tasks / check-list items to #35. They are going to be their own PRs to keep this PR consumable and in order to also avoid having conflicts:
scanNode
#474typeIndexJoin
. #475averageNode
. #476commitSelectNode
. #477countNode
. #478dagScanNode
. #479renderNode
. #480sortNode
. #481sumNode
. #482updateNode
. #483