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 queries founded. #38

Open
hellohasan opened this issue Jun 27, 2022 · 3 comments
Open

N+1 queries founded. #38

hellohasan opened this issue Jun 27, 2022 · 3 comments
Labels
question Further information is requested

Comments

@hellohasan
Copy link

image

I am using beyondcode/laravel-query-detector it warns me of the upper image. how I can prevent the egger loading.

Please help.

@codebyray
Copy link
Owner

codebyray commented Aug 17, 2022

@hellohasan What method are you calling that causes this?

@codebyray codebyray added the question Further information is requested label Aug 18, 2022
@hellohasan
Copy link
Author

$ratings = $course->getAllRatings($course->id, 'desc');

In the getAllRatings method, I retrieve all ratings and try to show the rating with author's name, this time the N+1 warning occurs.

image

@codebyray
Copy link
Owner

Thank you for the reply. I will have a look at it and geta fix in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants