Investigate an application performance problem with DPA
The following example shows how DPA can be used to find the root cause of an application performance problem.
The problem
Users are complaining about the performance of an application developed in-house. The performance problems always occur around 2 PM, during core business hours.
The investigation
-
From the DPA home page, click the database instance that the application runs against.
The Top SQL Statements trend chart shows the 15 SQL statements with the highest wait times for the past 31 days.
-
Click a bar that represents a day when users experienced slow performance.
The chart shows the top SQL statements for each hour. During the 2 PM hour, one SQL statement caused significantly longer waits than all the others.
-
Point to that segment in the bar to display additional information about the SQL statement. Note the SQL hash.
-
In the chart legend, click the hash value that represents the SQL statement.
The Query Detail page displays DPA's analysis of the query performance, including the types of waits, query advisors, and the most relevant charts. By default, the time period is the same as the period that you selected on the trends chart.
-
To make this statement easier to identify in charts and reports, name the SQL statement:
- In the upper-right corner, click SQL Properties.
- In the SQL Properties dialog, enter the name and click OK.
Legends and reports now identify the SQL statement by name instead of by hash value.
-
Look at the Top Waits chart to see what type of waits are causing delays.
The chart shows that this SQL statement spends most of its time in Memory/CPU waits.
-
Click the information icon next to the wait type in the legend to see more information about Memory/CPU waits.
DPA provides detailed information about this wait type, including possible solutions.
-
In the Query Advisors section, notice that DPA's analysis shows that a full table scan is being performed and suggests adding an index.
You can click the full table scan link for details, or click the plan hash on the right to view the plan.
Before you add the index, you decide to find out more about where this query comes from.
-
Click the Supporting Data tab, which shows that the query is being run by Accounting.
Rather than add an index immediately, you decide to first contact the Accounting team and ask if they can tune the SQL statement. In this scenario, the Accounting department replies that the SQL statement cannot be changed. With this information, you decide to add the index.
After you add the index, you can add an annotation to let the rest of the team know what changed and to help determine whether the change is effective.
The new index improves the execution time of the SQL statement, and users no longer complain about slow performance when it runs.
Next steps
- To make sure this SQL statement doesn't cause problems in the future, you can add an alert to notify you if the average wait time for this statement increases.
- You can create a report to track wait times and determine if your tuning efforts were effective.
- For other examples of using DPA to investigate a performance issue, see: