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

[ZoomAccounts] Fix N+1 issue in availability field #18

Closed
thenamankumar opened this issue May 14, 2020 · 7 comments · Fixed by #82
Closed

[ZoomAccounts] Fix N+1 issue in availability field #18

thenamankumar opened this issue May 14, 2020 · 7 comments · Fixed by #82
Assignees
Labels

Comments

@thenamankumar
Copy link
Contributor

thenamankumar commented May 14, 2020

To improve the performance of the query by reducing the no. of separate db queries. Need to batch the availability status check queries in zoomAccount.availability.

Problem: N+1
Solution: Dataloader
Learn: https://www.youtube.com/watch?v=OQTnXNCDywA

@coderrsid
Copy link
Contributor

Can i work on this @hereisnaman ?

@thenamankumar
Copy link
Contributor Author

@coderrsid sure, I am assigning it to you. Let me know if you need any help.

@coderrsid
Copy link
Contributor

Although it'll be a big implementation. Sure i'll see what i can do.

@coderrsid
Copy link
Contributor

@hereisnaman How exactly the query is reaching N+1 issue. I am not able to quite find that!

image

@thenamankumar
Copy link
Contributor Author

@coderrsid
For the query:

query FetchZoomAccounts {
  ZoomAccounts(availableDuring: ...) {
    id
    availability(dateTimeRange: ...)
  }
}

The number of sql queries will be:
1 for finding the list of N zoom accounts.
N queries to find the availability of each of them.

@coderrsid
Copy link
Contributor

Hey naman, should i wait for the another similar issue for CalendarInvite as he also added dataloader package, so i don't want that package version conflicts happen??

@thenamankumar
Copy link
Contributor Author

Hey naman, should i wait for the another similar issue for CalendarInvite as he also added dataloader package, so i don't want that package version conflicts happen??

That is a 1 line change, how hard will it be to resolve it even if that comes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants