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 the attributes of limit (renderLimitNode / hardLimitNode) #561

Closed
shahzadlone opened this issue Jun 24, 2022 · 0 comments · Fixed by #614
Closed

Explain the attributes of limit (renderLimitNode / hardLimitNode) #561

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

Comments

@shahzadlone
Copy link
Member

Subtask of #35.

Explain the attributes of the limit aspect of the planner. Investigate into renderLimitNode or hardLimitNode.

@shahzadlone shahzadlone added feature New feature or request area/query Related to the query component labels Jun 24, 2022
@shahzadlone shahzadlone added this to the DefraDB v0.3 milestone Jun 24, 2022
@shahzadlone shahzadlone self-assigned this Jun 24, 2022
shahzadlone added a commit that referenced this issue Jul 12, 2022
- Resolves: #561 

- Description: Adds the `limit` and `offset` attributes for both `renderLimitNode` and `hardLimitNode` to be included in the returned explain graph response.

- Request:
```
query @Explain {
	author(limit: 3, offset: 1) {
		numberOfArts: _count(articles: {})
		articles(limit: 2) {
			name
		}
	}
}
```

- Response:
```
{
  "data": [
    {
      "explain": {
        "selectTopNode": {
          "hardLimitNode": {
            "limit": 3,
            "offset": 1,
            "countNode": {
              "sources": [
                {
                  "fieldName": "articles",
                  "filter": null
                }
              ],
              "selectNode": {
                "filter": null,
                "typeIndexJoin": {
                  "joinType": "typeJoinMany",
                  "rootName": "author",
                  "root": {
                    "scanNode": {
                      "collectionID": "3",
                      "collectionName": "author",
                      "filter": null,
                      "spans": [
                        {
                          "end": "/4",
                          "start": "/3"
                        }
                      ]
                    }
                  },
                  "subTypeName": "articles",
                  "subType": {
                    "selectTopNode": {
                      "renderLimitNode": {
                        "limit": 2,
                        "offset": 0,
                        "selectNode": {
                          "filter": null,
                          "scanNode": {
                            "collectionID": "1",
                            "collectionName": "article",
                            "filter": null,
                            "spans": [
                              {
                                "end": "/2",
                                "start": "/1"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}
```
shahzadlone added a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
…urcenetwork#614)

- Resolves: sourcenetwork#561 

- Description: Adds the `limit` and `offset` attributes for both `renderLimitNode` and `hardLimitNode` to be included in the returned explain graph response.

- Request:
```
query @Explain {
	author(limit: 3, offset: 1) {
		numberOfArts: _count(articles: {})
		articles(limit: 2) {
			name
		}
	}
}
```

- Response:
```
{
  "data": [
    {
      "explain": {
        "selectTopNode": {
          "hardLimitNode": {
            "limit": 3,
            "offset": 1,
            "countNode": {
              "sources": [
                {
                  "fieldName": "articles",
                  "filter": null
                }
              ],
              "selectNode": {
                "filter": null,
                "typeIndexJoin": {
                  "joinType": "typeJoinMany",
                  "rootName": "author",
                  "root": {
                    "scanNode": {
                      "collectionID": "3",
                      "collectionName": "author",
                      "filter": null,
                      "spans": [
                        {
                          "end": "/4",
                          "start": "/3"
                        }
                      ]
                    }
                  },
                  "subTypeName": "articles",
                  "subType": {
                    "selectTopNode": {
                      "renderLimitNode": {
                        "limit": 2,
                        "offset": 0,
                        "selectNode": {
                          "filter": null,
                          "scanNode": {
                            "collectionID": "1",
                            "collectionName": "article",
                            "filter": null,
                            "spans": [
                              {
                                "end": "/2",
                                "start": "/1"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}
```
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.

1 participant