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

Warning! Roles, index page causes N+1 query for each user. #7

Open
tanthammar opened this issue Jan 16, 2020 · 0 comments
Open

Warning! Roles, index page causes N+1 query for each user. #7

tanthammar opened this issue Jan 16, 2020 · 0 comments

Comments

@tanthammar
Copy link

The Roles index, permissions and users count() column, causes an extra query for each user in entire db, in my case over 3000 ...
It gave me a server error 500 every time I tried to load the page.
Php ran out of memory.

Monitoring the User retrieved event made me find the issue.

Suggesting to remove these rows in /src/Resources/Role.php

Text::make('permissions count')->withMeta(['value' => count($this->permissions)])->exceptOnForms(),
Text::make('users count')->withMeta(['value' => count($this->users)])->exceptOnForms(),
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