-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Show more query information: duplicates, n+1 problems #389
Comments
thanks! we actually already do support n+1 query detection in the laravel integration. check out this blog post to see what it looks like - https://underground.works/blog/clockwork-4.0-released-with-ui-improvements-requests-search-and-more we do the detection server-side, that's the only way to detect the duplicates with a reasonable confidence. |
Oh great! Missed that one, was looking at old configuration. Two more questions:
|
1 this implementation is specifically aimed at programmer errors when using eloquent, eg. missing eager loads, etc. we actually hook into eloquent and compare stack traces and stuff, we don't even care about the sql itself. alternatively we could simply look at all executed sql and find the duplicates that way. this is definitively a valid approach, but would lead to a lot more false positives. eg. in a user admin view, you would load the current logged in user in the auth component and later the edited user, which produces the same sql with a different id condition. you wouldn't consider this a performance issue, as the queries are done in very different contexts. that being said, it's really easy to implement "simple duplicates" detection, i can share some code if you would like to try it. 2 i can see how that would be helpful, i might have an idea on how it would look like i'd like to explore. |
Absolutely love the way clockwork works!
Would be really nice to expand the query information boxes with duplicates and n+1 problems to help developers spot these. Would that be possible?
Let me know if there's anything I can do to help :) Might need some guidance though.
The text was updated successfully, but these errors were encountered: