Performance insight (new version)

更新时间:
复制 MD 格式

Performance Insight (new version) analyzes SQL execution statistics collected by MySQL's Performance Schema to help you identify the root causes of database performance issues. With Performance Insight, you can:

  • Track resource usage, execution counts, scanned rows, and execution duration for all SQL statements

  • Drill into individual SQL statements to view execution trends and sample queries

  • Compare SQL performance across different time periods to isolate regressions

  • Apply SQL throttling or run diagnostics to optimize problem queries

  • Identify tables and indexes with no traffic to detect unused objects

Performance Insight (new version) is in public preview and free to use.

Prerequisites

Before you begin, ensure that:

  • The instance is a PolarDB for MySQL cluster

  • The instance has at least 8 GB of memory

  • Performance Schema is enabled on the instance — if not, see Enable the Performance Schema feature

    Warning

    Enabling Performance Schema requires a parameter change and an instance restart. Perform this during off-peak hours and verify that your application reconnects automatically after the restart.

  • The instance is in one of the following regions: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Shenzhen), China (Chengdu), China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), or Indonesia (Jakarta)

How it compares to the original version

ItemNew versionOriginal version
MetricsResource Usage, Executions, Scanned Rows, Execution Duration for all SQL statements; Executions/Errors, Scanned Rows/Updated Rows/Returned Rows, Logic Read, Physical Reads, Average Execution Duration/AvLock 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 for databasesMemory Usage/CPU Utilization, Session, Traffic Throughput, IOPS for databases; active session trends and multidimensional loads by SQL statement category
Displayed detailsMetric trends + SQL details within a time range; cross-period comparison; query by SQL ID or keyword; tables and indexes with no trafficMetric trends + SQL details within a time range only
SolutionsSQL throttling and optimizationOptimization only
Supported database enginesApsaraDB RDS for MySQL, PolarDB for MySQL, ApsaraDB MyBase for MySQLApsaraDB RDS for MySQL, ApsaraDB RDS for PostgreSQL, PolarDB for MySQL, PolarDB for PostgreSQL, ApsaraDB MyBase for MySQL, PolarDB for PostgreSQL (Compatible with Oracle)

Enable Performance Insight

  1. Log on to the DAS console.

  2. In the left-side navigation pane, click Instance Monitoring.

  3. Find the instance you want to manage and click its ID.

  4. In the left-side navigation pane, click Performance Insight.

  5. On the Performance Insight tab, click Enable Performance Insight. If Performance Schema is disabled, the Parameter Settings dialog box appears. Click Configure to enable it. See Enable the Performance Schema feature for details.

Enabling Performance Insight automatically enables the identification of tables and indexes with no traffic.

Important

If you enabled Performance Insight before April 11, 2023, this automatic enablement did not apply. To activate the feature, open the Service Settings dialog box and manually turn on Identification for Tables and Indexes with No Traffic.

Use Performance Insight

After enabling Performance Insight, select a tab based on your goal.

新版

Display by Time Range

Use this tab to analyze SQL performance over a specific period.

  1. Select a time range. The end time must be later than the start time. Data is queryable within any seven-day window in the past month. The Resource Usage, Executions, Scanned Rows, and Execution Duration trend charts update to reflect the selected range.

  2. To view additional performance metric charts, click ShowMore Metrics.

    Click Settings to choose which metrics to display.

    设置指标

  3. Click Export to save the data as a file to your computer.

  4. In the SQL list, use the following actions on individual SQL statements:

    Click Settings in the SQL list and go to Column Settings to choose which performance metrics appear as columns.
    • View trends: Click the SQL statement ID to open the Resource Usage, Executions, Scanned Rows, and Execution Duration charts for that statement, along with its SQL samples.

    • View samples: Click Sample in the Actions column.

    • Throttle: Click Throttling in the Actions column to configure throttling rules in the SQL Throttling dialog box. See SQL throttling for details.

    • Optimize: Click Optimize in the Actions column to open the SQL Diagnostic Optimization dialog box. After diagnostics complete, the engine returns results, optimization suggestions, and expected benefits. Diagnostics run based on SQL complexity, table data volume, and current database load — results may take more than 20 seconds to appear. To apply the suggestions, click Copy in the upper-right corner and paste the optimized SQL into your database client or Data Management (DMS) for execution. To discard them, click Cancel.

      Note

      For expert-level database assistance — including emergency response, health diagnostics, performance optimization, security assurance, and data migration — click Database Expert Service.

Display by Comparison

Use this tab to compare SQL performance between two points in time and identify regressions.

Select a reference point in time. The tab shows side-by-side comparison results for resource usage, execution count, scanned rows, and execution duration across all SQL statements. The SQL list below shows the detailed breakdown per statement.

Click Settings to choose which performance metrics appear in the SQL list.

Tables/Indexes

Use this tab to find unused tables and indexes.

Set filter conditions to query tables and indexes with no traffic. Results appear in two sections:

  • Tables with No Traffic

  • Indexes with No Traffic

DAS collects traffic statistics every early morning and records the number of days during which no operations are performed on each table or index.

Click Export to save the filtered results to your computer.

Disable Performance Insight

Disabling Performance Insight also disables the identification of tables and indexes with no traffic, and deletes all collected historical data — including statistics for both tables/indexes with no traffic and those with traffic.

To disable:

  1. Log on to the DAS console.

  2. In the left-side navigation pane, click Instance Monitoring.

  3. Find the instance and click its ID.

  4. In the left-side navigation pane, click Performance Insight.

  5. On the Performance Insight tab, click Service Settings.

  6. In the Service Settings dialog box, turn off Feature Setting and click OK. Confirm by clicking OK in the dialog box that appears.

To disable only the no-traffic identification feature while keeping Performance Insight active, turn off Identification for tables and indexes with no traffic is disabled instead of Feature Setting. After this feature is disabled, DAS deletes the statistics on tables and indexes on which no operations are performed and the statistics on tables and indexes on which operations are performed.

关闭新版