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

Add meaning of yellow icon for number of queries #4842

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@ to easily fetch objects based on multiple conditions::

If you click the icon, the profiler will open, showing you the exact
queries that were made.

If you make more than 50 queries on a page, the icon will turn yellow to
let you know that you are making a lot of requests to the database. This
is only a warning and does not have any effect on the execution of further
queries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only a warning, but it means there is potentially an issue in your page (N+1 requests because of proxy initialization in a loop for instance). The warning is here for a reason. Such number of queries is often an issue

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Are you saying here we should tell the user more aggressively that they should keep the number of queries below 50?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, they should be careful if it goes higher (especially if it happens often). Note that 50 is quite arbitrary here. Blackfire may turn the corresponding metric into red on a different threshold for instance.
the general rule is that lots of DB queries is a bad sign for perf (because DB queries take time)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the clarifiation, but I think it's a bit too long. What do you think about:

The icon will turn yellow if there were more than 50 queries on the page, this could indicate that something is not correct.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sounds great to me. I was mainly concerned with getting the information about the yellow icon in there.


Updating an Object
~~~~~~~~~~~~~~~~~~
Expand Down