Skip to content

N+1 query issues on char_list #83

@flashadvocate

Description

@flashadvocate

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+.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions