Troubleshooting SQL Tuning issues
Symptom
- End users are reporting slowness with specific actions. Some SQL queries take a long time to complete.
Scope
- One or more users across multiple servers in a server group.
- Back-end processes instead of user activities.
Diagnosing and reporting an issue
Step | Task | Description |
1 | Identify the inefficient SQL Statement | Use the Troubleshooting-AR-System-performance-issues-by-using-AR-Log-Analyzer topic or database tools to identify inefficient SQLs that are impacting performance. Identify what the expected times are and what the actual response was found to be. Note that some SQLs, such as running complex reports, are expected to take time to complete. Focus your analysis on SQL statements that are expected to return quickly but cause a delay. |
2 | Is there an obvious problem with the query? | Look for obvious problems with the query, including the following:
If any of these obvious problems exist with the SQL in question, the problem is going to be one of the following:
|
3 | Determine if an index could be used but does not exist | Check to see if the SQL statement includes qualifications that are likely to use an index, such as:
If there a qualification that you suspect should use an index but appears not to be, check the form properties to ensure that an index exists. In most cases, in order to use the index, it should be present in the first column/field of a composite index. If you believe that an index does not exist but should exist, create a support case. |
4 | Determine the origination of the SQL | SQLs are often dynamically generated by the AR System Server based on workflow, permissions, database type, and field population. Using API/SQL/Filter logging with AR Log Analyzer, identify if the SQL was generated based on a specific piece of workflow or if it was a result of a simple user query. Create a support case if it appears that the SQL was generated by the Out-of-the-box application. |
5 | Determine if User Behavior can improve the situation | If the SQL resulted from a customer query, identify if the problem can be resolved with user behavior. For example, a user looking for 'All Open' cases may not be able to get a fast result because an index is not used. Narrow the scope of the query such as searching for 'All My Open' cases. |
6 | Identify workflow that caused the inefficient SQL | If you can identify the workflow, table field, or other reason for the query, create a support case so that BMC can provide a short and a long-term solution. |
7 | Find a solution | a. Use the following table to troubleshoot specific problems with slow SQL statements. b. If the cause has not been found or no solution is available, proceed to the next step to gather logs and create a support case. |
8 | Collect relevant logs | If you're still experiencing issues after following the steps or if you're unable to complete any of the preceding steps, run the log zipper utility to collect the API, SQL, and Filter logs relevant to the problem. These logs will be requested from the BMC Support when submitting a case on performance issues. You will need to run it on each server that you enabled the logs on. Rename the zipped file to contain the server name. |
9 | Create a Support Ticket | Collect and send output of AR Log Analyzer and detailed information when creating a case with BMC Support:
|
Errors and resolution
Error | Where | Resolution | Reference |
---|---|---|---|
Index is missing | Developer Studio | Add an Index | |
Missing indexes for the field "Parent Request ID" (1000002706) on the form AST:CMDB Associations | Developer Studio | Add an Index | |
When you create entries on a form and create a web service request to fetch data for that form, the return query includes all columns, which might cause a performance issue. | AR System Server, Mid Tier, Developer Studio |
|
Related topics
Communities: Approvals not processing from the Application Pending form