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

Querying secondary relationships slow as db size increases #3190

Open
david-on-github opened this issue Oct 28, 2024 · 0 comments
Open

Querying secondary relationships slow as db size increases #3190

david-on-github opened this issue Oct 28, 2024 · 0 comments

Comments

@david-on-github
Copy link
Member

Responses to queries with secondary relationships become incrementally slower relative to the size of the db. (Including unrelated collections)

Example Schema

type Dog {
  name: String
} 

type Director {
  name: String 
  movies: [Movie] @relation(name: "directorMovies")
}

type Movie {
  title: String
  director: Director @primary @relation(name: "directorMovies")
}

*Note: Dogs is not related to Director or Movies + Not included in this query:

query {
  Director {
   movies {
     _docID
   } 
  }
}

Calling the above query gives the following response times (where number of documents in the db is):

Db seeded with:  0 Directors with 0 movies

0 Dogs 22ms
1000 Dogs 23ms
2000 Dogs 31ms
3000 Dogs 37ms
4000 Dogs 30ms
5000 Dogs 46ms
Db seeded with: 100 Directors with 1 movie each

0 Dogs 124ms
1000 Dogs 307ms
2000 Dogs 625ms
3000 Dogs 727ms
4000 Dogs 921ms
5000 Dogs 1177ms
Db seeded with: 200 Directors with 0 movies

0 Dogs 116ms
1000 Dogs 513ms
2000 Dogs 884ms
3000 Dogs 1322ms
4000 Dogs 1788ms
5000 Dogs 2199ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant