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

Optimzing Search on Foreign Keys #39

Closed
king-11 opened this issue May 16, 2021 · 0 comments · Fixed by #47
Closed

Optimzing Search on Foreign Keys #39

king-11 opened this issue May 16, 2021 · 0 comments · Fixed by #47
Labels
good first issue Good for newcomers

Comments

@king-11
Copy link
Member

king-11 commented May 16, 2021

The problem associated with a search on foreign keys is related to the N+1 problem where more than required times the Database is hit, which we can reduce by using select_related and prefetch_related for one to many and many to many keys where joins would allow DB to be hit only once rather than multiple times reducing the querying time.

InstiApp/lite-hai-backend#80 and InstiApp/lite-hai-backend#82 can be taken as a reference for this

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

Successfully merging a pull request may close this issue.

2 participants