New Relic's Database feature shows individual database transactions as a table that you can sort. It also shows database operations, throughput, and response time as charts. If slow SQL information is available, it appears in the Slow SQL traces section at the bottom of the dashboard.
Note: The Slow SQL feature is for New Relic Pro and higher.
To view information about database performance: From the New Relic menu bar, select Applications > (selected app) > Monitoring > Database.
Tip: If you are doing general record cleanup, you may also want to delete transaction traces or error traces. This will remove potentially sensitive data while retaining your other application data (such as Apdex, deployment information, etc.).
Slow SQL samples are examples of the worst performing SQL on your site. Along with the SQL, New Relic collects the context and diagnostic information you need to fix your database performance issues.
To view slow SQL information:
New Relic includes a stack trace and the start time. The stack trace shows you where in the code the statement was called, and the start time shows you when it was collected.
To diagnose the problem, New Relic shows the maximum time for all similar collected SQL statements and the total number of statements collected (the sample count). This is not the total number of times it was called in your application, but the number of times New Relic identified it as one of the slower SQL statements in your site. In addition, New Relic collects the explain plan whenever possible.
In MySQL, New Relic provides a query analysis, which explains what happened in your query and what you might do to speed it up. Other databases display an explain plan.
The agent captures all SQL that exceed the transaction trace explain plan threshold. The agent aggregates similar statements together but only keeps the details for the worst of each similar statement. Every minute, the agent sends several samples to the New Relic service. These represent the worst performing SQL statements during that minute.
To define your SQL obfuscation preferences:
Note: PHP users must use their .ini file, not the user interface, to define slow SQL settings.
If you do not see slow SQL in the New Relic user interface, make sure:
Additional documentation resources include:
If you need additional help, get support at support.newrelic.com.