Performance Insight is a SQL-level diagnostics feature for PolarDB for MySQL. Built on MySQL's performance_schema and integrated with Database Autonomy Service (DAS), it aggregates statistics across all SQL statements running on your cluster, so you can identify which statements consume the most resources, pinpoint performance bottlenecks, and apply throttling or optimization.
Prerequisites
Before you begin, ensure that you have:
-
A PolarDB for MySQL cluster with at least 8 GB of memory
-
The
loose_performance_schemaorperformance_schemaparameter set to ON — see Specify cluster and node parameters -
A cluster deployed in one of the supported regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), or China (Chengdu)
Billing
Performance Insight is in public preview and is free to use during the public preview.
Comparison with the original version
Performance Insight (new) extends the original version with more metrics and additional ways to explore them.
| Performance Insight (new) | Performance Insight (original) | |
|---|---|---|
| Metrics | SQL-level trends: Resource Usage, Executions, Scanned Rows, Execution Duration — plus cluster-level trends: CPU Utilization, Executions/Errors, Scanned Rows/Updated Rows/Returned Rows, Logic Read, Physical Reads, Average Execution Duration/Average Locking Duration, Number of Created Temporary Tables/Number of Created Temporary Disk Tables, Number of Sorted Rows, Select_Scan/Select_Range/Full Join/Full Range Join/Sort_Scan/Sort_Range, Top 5 SQL Trends | Cluster-level trends: Memory Usage/CPU Utilization, Session, Traffic Throughput, IOPS; active session trends |
| View methods | Time range view; comparison view; query by SQL ID or keyword | Time range view only |
| Governance | SQL throttling and optimization | SQL optimization only |
Enable Performance Insight
-
Log on to the PolarDB console.
-
In the upper-left corner, select the region where your cluster is deployed.
-
On the Clusters page, find your cluster and click its ID.
-
In the left-side navigation pane, choose Diagnostics and Optimization > Diagnosis.
-
On the Performance Insight tab, click Enable Performance Insight.
To switch to the original version, click Back to Previous Version. For details about the original version, see Performance Insight (original version).
Analyze SQL performance
After enabling Performance Insight, select a subtab based on your diagnostic goal.
Display by Time Range
Use this view to examine SQL activity over a specific period.
-
Select a start time and end time.
NoteThe end time must be later than the start time. Queries are limited to a maximum of seven consecutive days within the last month.
-
The dashboard shows trend charts for Resource Usage, Executions, Scanned Rows, and Execution Duration across all SQL statements in that period.
-
To export the data, click Export.
-
To view cluster-level performance metrics, click Show More Metrics.
NoteClick Settings to choose which metrics appear in the chart.
-
In the SQL list, perform the following actions on individual statements:
-
Click Settings and use the Column Settings section to select which performance metrics appear as columns.
-
Click a SQL ID to view the Resource Usage, Executions, Scanned Rows, and Execution Duration trends for that statement, along with its SQL sample details.
-
Click Sample in the Actions column to view the SQL sample details for a statement.
-
Click Throttling in the Actions column to open the SQL Throttling dialog box and configure throttling parameters. For details, see SQL throttling.
-
Click Optimize in the Actions column to open the SQL Diagnostic Optimization dialog box and review diagnostic results. If the suggestions are useful, click Copy in the upper-right corner and paste the optimized SQL into your database client or Data Management (DMS) for execution. To dismiss without applying, click OK.
To get expert help, click Database Expert Service to purchase professional support, including emergency assistance, health diagnostics, performance optimization, security assurance, and data migration.
-
Display by Comparison
Use this view to compare SQL performance between two points in time — for example, before and after a schema change or traffic spike.
Select a point in time. The dashboard shows side-by-side comparison results for Resource Usage, Executions, Scanned Rows, and Execution Duration across all SQL statements. The SQL list below the chart shows the detailed comparison per statement.
Click Settings to choose which metrics appear in the SQL list.
Tables/Indexes
Use this view to inspect table and index information. Filter by database name, table name, or days without traffic to identify unused indexes or stale tables.
Disable Performance Insight
Disabling Performance Insight stops data collection and deletes all historical data.
-
Log on to the PolarDB console.
-
In the upper-left corner, select the region where your cluster is deployed.
-
On the Clusters page, find your cluster and click its ID.
-
In the left-side navigation pane, choose Diagnostics and Optimization > Diagnosis.
-
On the Performance Insight tab, click Service Settings.
-
In the Service Settings dialog box, turn off Feature Setting and click OK.
-
In the confirmation message, click OK.