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

N+1 query issues on char_list #83

Open
flashadvocate opened this issue Dec 29, 2022 · 0 comments
Open

N+1 query issues on char_list #83

flashadvocate opened this issue Dec 29, 2022 · 0 comments

Comments

@flashadvocate
Copy link
Collaborator

flashadvocate commented Dec 29, 2022

Querying for guild name accounts for at 1 additional query per character listed. Another query "to disalow lower lvl gm to view accounts of other gms" accounts for an additional query per character, making a total of 75+ queries for a list of 25. At scale, that's 300 queries on a page of 100, 600 queries on a page of 200, etc.

The cause is that these queries are being executed inside the for loop building the rows for each character. So the initial query should probably be improved / data eager loaded to include the additional data via join.

This should significantly improve the overall performance of that particular page, especially in cases where someone sets pagination limits to 100+.

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