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(core): Fix performance issue in type filter (#9065) #9089

Merged
merged 1 commit into from
May 15, 2024

Conversation

harshil-goel
Copy link
Contributor

Currently when we do queries like func(uid: 0x1) @filter(type). We retrieve the entire type index. Sometimes, when the index is too big, fetching the index is quite slow. We realised that if we know we only want to check few uids are of the same, then we can just check those uids directly. Right now we are hard coding the number of uids threshold. This could be improved with a more statistical based model, where we figure out how many items does the type index have, how many we need to check.

Currently when we do queries like `func(uid: 0x1) @filter(type)`. We
retrieve the entire type index. Sometimes, when the index is too big,
fetching the index is quite slow. We realised that if we know we only
want to check few `uids` are of the same, then we can just check those
`uids` directly. Right now we are hard coding the number of `uids`
threshold. This could be improved with a more statistical based model,
where we figure out how many items does the type index have, how many we
need to check.
@harshil-goel harshil-goel requested a review from a team as a code owner May 15, 2024 07:21
@dgraph-bot dgraph-bot added area/testing Testing related issues area/core internal mechanisms go Pull requests that update Go code labels May 15, 2024
@harshil-goel harshil-goel merged commit 6e7896e into main May 15, 2024
13 checks passed
@harshil-goel harshil-goel deleted the harshil-goel/type-fix branch May 15, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core internal mechanisms area/testing Testing related issues go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

None yet

3 participants