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

perf(GraphQL): Part-4: Child auth queries are derived from auth filtered parents (GRAPHQL-854) #7111

Merged
merged 8 commits into from Dec 11, 2020

Conversation

abhimanyusinghgaur
Copy link
Contributor

@abhimanyusinghgaur abhimanyusinghgaur commented Dec 10, 2020

This PR optimizes auth query rewriting by deriving child auth queries from auth filtered parents instead of all possible parents. This reduces the number of touched_uids at deep levels. This performance benefit comes into effect when there are a lot of nested levels in auth rules.


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Dec 10, 2020
@netlify
Copy link

netlify bot commented Dec 10, 2020

✔️ Deploy preview for dgraph-docs ready!

🔨 Explore the source changes: 4a00b50

🔍 Inspect the deploy logs: https://app.netlify.com/sites/dgraph-docs/deploys/5fd25bc7d62da400083f1e28

😎 Browse the preview: https://deploy-preview-7111--dgraph-docs.netlify.app

Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: also check if ordering at root with filter and auth works correctly in a separate PR and add an e2e test for that

Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @abhimanyusinghgaur and @MichaelJCompton)


graphql/resolve/query_rewriter.go, line 969 at r1 (raw file):

	// This query aggregates all filters and auth rules and is used by root query to filter
	// the final nodes for the current level.
	// User6 as var(func: uid(User2), orderasc: ...) @filter((eq(User.username, "User1") AND (...Auth Filter))))

check if orderasc is applied here

Copy link
Contributor Author

@abhimanyusinghgaur abhimanyusinghgaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @MichaelJCompton and @pawanrawal)


graphql/resolve/query_rewriter.go, line 969 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

check if orderasc is applied here

Done.

@abhimanyusinghgaur abhimanyusinghgaur merged commit e2d93de into master Dec 11, 2020
@abhimanyusinghgaur abhimanyusinghgaur deleted the abhimanyu/auth-perf-4 branch December 11, 2020 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

None yet

2 participants