Performance Insight is a feature for database performance optimization, load monitoring, and association analysis. This feature provides an intuitive and easy way for you to evaluate database loads and find the causes of performance issues and the problematic SQL statements. Then, you can determine how to improve database performance based on these causes.

Procedure

  1. Log on to the PolarDB console.
  2. On the top of the page, select the region where the target cluster is located.
  3. On the Clusters page, click the ID of the cluster that you want to manage.
  4. In the left-side navigation pane, choose Diagnostics and Optimization > Diagnosis.
  5. On the page that appears, click the Performance Insight tab.
  6. On the Performance Insight tab, click Enable Performance Insight.
    Performance insight
  7. In the message that appears, click Confirm.
  8. On the Performance Insight tab, view and manage the performance information.
    • In the Performance Trend section, you can specify a time range to view the performance metrics of databases. If you want to view the details of a specific performance metric such as CPU usage, click Details next to the performance metric name.Performance trends
      Note The duration of the specified time range cannot exceed seven days.
    • In the Average Active Session section, you can select a session type to view the corresponding trend charts. For example, you can select SQL as the session type. In this section, you can also view the multidimensional details of service loads for each session type. This helps you identify the root causes of performance issues.Active sessionsMultidimensional details of service loads

Data indicators

Performance Insight uses the pg_stat_activity view as a data source. After data sampling is implemented based on this view, you can obtain the following information:

  • Users and wait events
  • SQL statements and hosts
  • Databases and connection statuses

Comparison between the regular troubleshooting process and the Performance Insight-based troubleshooting process

Issue Regular troubleshooting process Performance Insight-based troubleshooting process
At a specific time point, an UPDATE SQL statement slows down, or a large number of logs related to the UPDATE statement are found in audit logs.
  • Check the performance monitoring data.
  • Check the logs of slow SQL queries.
  • Check a large number of audit logs.
  • Specify a time range during which the issue occurs.
  • Select different performance metrics to reflect different aspects of the issue.
  • Find the problematic SQL statement.
  • Check the status of the problematic SQL statement.
The time required to execute a same SQL statement on different clients varies in a significant way. The clients are deployed in different data centers.
  • Check the performance monitoring data.
  • Perform analysis based on network packet capture.
  • Specify a time range during which the issue occurs.
  • Check the host statuses.
  • Find the causes based on multidimensional information.