This topic describes how to analyze the slow SQL statements on an ApsaraDB RDS for SQL Server instance in the ApsaraDB RDS console.

Prerequisites

The RDS instance is equipped with standard SSDs or enhanced SSDs (ESSDs).

Background information

You can analyze slow SQL statements to troubleshoot the performance issues of an ApsaraDB RDS for SQL Server instance. This method is common and effective. SQL statements that consume a large number of CPU resources or I/O resources, require a long period of time to run, or affect a large number of rows may be slow SQL statements. The CloudDBA feature of ApsaraDB RDS records and analyzes these SQL statements and displays the analysis results on the Slow SQL page. The analysis results can be used to identify the SQL statements that affect the performance of the instance. The analysis results also help simplify the performance optimization process.

Procedure

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, choose CloudDBA > Slow SQL.

Introduction to the Slow SQL page

  • Slow SQL Query Trend sectionSlow SQL Query Trend section
    This section displays the CPU utilization and number of slow SQL statements over a specific time range. You can also perform the following operations:
    • Specify the Start time and End time. Then, click Search to view the trend of slow SQL statements over the time range that you specify.
      Note The interval between the start time and end time cannot exceed one day.
    • Click Last 30 Minutes to view the trend of slow SQL statements over the last 30 minutes or click Last 1 Hour to view the trend of slow SQL statements over the last 1 hour.
    • Move the pointer over a specific point in time to view the CPU utilization and number of slow SQL statements at the selected point in time. Click the selected point in time. In the lower section of the page, view the statistics and details about the slow SQL statements at the selected point in time.
    • In the upper-right corner, click one of the Icon icons to perform the operations that are supported. The following table describes the icons.
      Icon Name Description
      Zoom Zoom Allows you to enable or disable the zooming feature. After you enable the zooming feature, you can click a specific point in time and drag the pointer in the trend chart to select a time range. Then, the Slow SQL Query Trend section displays only the trend of slow SQL statements over the selected time range.

      By default, the zooming feature is enabled.

      Cancel Zoom Cancel Zoom Allows you to disable the zooming feature.
      Restore Restore Allows you to restore the trend chart to the initial status.
      Switch to Line Chart Switch to Line Chart Allows you to view the trend in a line chart.
      Switch to Bar Chart Switch to Bar Chart Allows you to view the trend in a column chart.
      Save as Image Save as Image Allows you to save the trend chart as an image to your computer.
  • Slow SQL Query StatisticsSlow SQL Query Statistics

    This section displays the statistics of slow SQL statements over a specific time range. The statistics of a slow SQL statement include the number of times that the slow SQL statement is executed, the average length of time that is required to run the slow SQL statement, and the total CPU utilization of the slow SQL statement.

  • Slow SQL Query DetailsSlow SQL Query Details

    This section displays the details about slow SQL statements over a specific time range. The details about a slow SQL statement include the name of the SQL statement, the name of the application that requests to execute the SQL statement, and the username of the account within which the SQL statement is executed.