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

Server has N+1 problem #577

Open
tylereed opened this issue Oct 19, 2024 · 0 comments
Open

Server has N+1 problem #577

tylereed opened this issue Oct 19, 2024 · 0 comments

Comments

@tylereed
Copy link
Contributor

When hitting an endpoint, the server is generating multiple SQL queries for each spell in the result set. This is because data linked through a foreign key is being accessed without telling django that it will be used.

When hitting https://api.open5e.com/v2/spells, 203 queries are generated.
When hitting https://api.open5e.com/v2/spells?depth=1, 253 queries are generated.

This is probably an issue with more than just spells, and is probably happening for other endpoints.

This is the classic N+1 problem, where the server is generating multiple queries.

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