The Diagnostics feature in PolarDB for MySQL integrates some capabilities from Database Autonomy Service (DAS). You can use the performance_schema capability to aggregate SQL information, assess the workload of your target database, identify the root causes of performance issues, and find solutions to improve database stability.
Prerequisites
-
The cluster must have at least 8 GB of memory.
-
The
loose_performance_schemaorperformance_schemaparameter is set to ON. For more information, see Set cluster and node parameters. -
This feature is available only for clusters in the China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), and China (Chengdu) regions.
Billing
Performance Insight (New) is in public preview and is free of charge.
Features
The Performance Insight (New) feature is based on the performance_schema capability of MySQL. It aggregates SQL information to help you assess the workload of your database and pinpoint the root causes of performance issues.
-
Quickly identify the Resource Usage, Executions, Scanned Rows, and Execution Duration for all SQL statements.
-
View performance trends for various database metrics and detailed information for specific SQL statements.
-
Query detailed information for specific SQL statements by SQL ID or keywords.
-
View trends for Resource Usage, Executions, Scanned Rows, and Execution Duration, as well as sample information for specific SQL statements.
-
Throttle and optimize specific SQL statements.
-
Compare Resource Usage, Executions, Scanned Rows, and Execution Duration for all SQL statements across different time periods. You can also compare detailed metrics for specific SQL statements.
Compared with the original version, the new version provides richer metric dimensions and viewing methods:
|
Item |
Performance insight (new) |
Performance insight (original) |
|
Metrics |
|
|
|
Viewing methods |
|
View metric trends and details for specific SQL statements within a specified time range. |
|
Governance solutions |
Throttle and optimize specific SQL statements. |
Optimize specific SQL statements. |
Procedure
- Log on to the PolarDB console.
-
In the navigation pane on the left, click Clusters。
-
In the upper-left corner, select the region where the cluster is deployed.
On the Clusters page, click the ID of the target cluster.
In the left-side navigation pane, choose .
-
On the Performance Insight tab, click Enable Performance Insight.
NoteIf you want to continue using the original version, click Return to Previous Version. For more information about how to use the original version, see Performance Insight (Original).
-
On the Performance Insight page, use the features based on your needs:
-
Range View:
-
Select a time range to view trend charts for Resource Usage, Executions, Scanned Rows, and Execution Duration for all SQL statements.
NoteThe end time must be later than the start time. You can view up to seven days of data from the past month.
-
Click Export to save the SQL information to your local machine.
-
Click Show More Metrics to view trend charts for key metrics.
NoteYou can click Settings and select the metrics to display in the Indicator section.
-
In the SQL list, view the details of SQL statements.
NoteYou can click Settings and, in the Column Settings section, select the statistical metrics to display.
-
Click a target SQL ID to view its trend charts for Resource Usage, Executions, Scanned Rows, and Execution Duration within the selected time range. You can also view SQL sample information.
-
In the Operation column for a target SQL statement, click Sample to view its sample information.
-
In the Operation column for a target SQL statement, click Throttling to configure its throttling parameters on the SQL Throttling page. For more information, see SQL Throttling.
-
In the Operation column for a target SQL statement, click Optimize to view the diagnosis results in the SQL Diagnostics and Optimization dialog box.
To apply the suggestion, click Replicate in the upper-right corner and paste the optimized SQL statement into a database client or DMS to run it. To dismiss the suggestion, click OK.
Alternatively, click Expert Service to purchase professional services such as emergency response, health diagnostics, performance tuning, security assurance, and data migration.
-
-
-
Display by Comparison: Select two time points to compare metrics such as Resource Usage, Executions, Scanned Rows, and Execution Duration for all SQL statements. The SQL list below provides a detailed comparison.
NoteYou can click Settings to select the statistical metrics to display in the list.
-
Tables/Indexes: View table and index information, filterable by database name, table name, or the number of days without traffic.
-
Disable performance insight
Disabling Performance Insight stops data collection and deletes all historical data.
- Log on to the PolarDB console.
-
In the navigation pane on the left, click Clusters。
-
In the upper-left corner, select the region where the cluster is deployed.
On the Clusters page, click the ID of the target cluster.
In the left-side navigation pane, choose .
-
On the Performance Insight tab, click Service Settings.
-
In the Service Settings dialog box, turn off the Feature Switch switch and click OK.
-
In the dialog box that appears, click OK.