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

Explain Request - Simple #325

Closed
8 tasks done
shahzadlone opened this issue Apr 5, 2022 · 0 comments · Fixed by #385
Closed
8 tasks done

Explain Request - Simple #325

shahzadlone opened this issue Apr 5, 2022 · 0 comments · Fixed by #385
Assignees
Labels
area/query Related to the query component feature New feature or request
Milestone

Comments

@shahzadlone
Copy link
Member

shahzadlone commented Apr 5, 2022

Sub Task of #35

Lays the ground work of the Explain logic. This Issue must be resolved before finishing all the explain attributes.

Spec: https://source.getoutline.com/doc/explain-queries-jtaGX0L995

Checklist:

  • Update schema to parse in @explain directive.
  • Ensure the @explain directive is strictly bound to it's location (with query and mutation blocks).
  • Ensure the @explain arguments are being read in properly.
  • Dump the plan graph from planner.
  • Plug in pre-execution and after plan is made.
  • Ensure execution is halted.
  • Structure the build graph in the ExplainResponse or map[string]interface{}.
  • Format the output to JSON.
@jsimnz jsimnz added this to the DefraDB v0.3 milestone Apr 5, 2022
@jsimnz jsimnz added area/query Related to the query component feature New feature or request labels Apr 18, 2022
@shahzadlone shahzadlone changed the title Explain Query - Simple Explain Query - Simple - JSON output Apr 19, 2022
@shahzadlone shahzadlone changed the title Explain Query - Simple - JSON output Explain Query - Simple (JSON) Apr 19, 2022
@shahzadlone shahzadlone changed the title Explain Query - Simple (JSON) Explain Request - Simple (JSON) Apr 26, 2022
@shahzadlone shahzadlone linked a pull request Apr 30, 2022 that will close this issue
shahzadlone added a commit that referenced this issue Jun 1, 2022
- RELATED ISSUES:
Resolves #325,
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 [d940f7b](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
            }
          }
        }
      }
    }
  ]
}
```
@shahzadlone shahzadlone changed the title Explain Request - Simple (JSON) Explain Request - Simple Mar 30, 2023
shahzadlone added a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
- 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
            }
          }
        }
      }
    }
  ]
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants