Manually querying system tables to trace lock waits—who is blocking whom, and why—requires deep familiarity with InnoDB internals and is time-consuming under production pressure. Database Autonomy Service (DAS) eliminates this by automatically analyzing metadata lock waits and transaction blocking in real time, generating visual relationship graphs so you can identify the blocking session and take action without writing a single query.
The data in the figures is for demonstration purposes only. In practice, parameters such as thread IDs and SQL statements will differ based on your actual database environment.
Prerequisites
Before you begin, make sure you have:
A database instance running RDS for MySQL or PolarDB for MySQL
The instance connected to DAS with a connection status of Normal Access. For more information, see Connect a database instance to DAS
Alibaba Cloud Managed Services (formerly known as Economy Edition) for DAS enabled
Alibaba Cloud Managed Services for DAS is available only in specific regions. For more information, see Supported databases and regions by edition. To enable it, see Manage Alibaba Cloud Managed Services (formerly known as Economy Edition) for DAS.
Lock types
DAS analyzes two types of locks:
| Lock type | Data sources | Limitation |
|---|---|---|
| Metadata lock analysis | information_schema.processlist | None |
| Transaction blocking analysis | information_schema.processlist, information_schema.innodb_trx, plus a version-specific table (see below) | Not supported for PolarDB for MySQL 5.6 instances |
Transaction blocking analysis: version-specific tables
| Engine version | Table |
|---|---|
| RDS for MySQL 5.6 and 5.7 | information_schema.innodb_lock_waits |
| PolarDB for MySQL 5.7 | information_schema.innodb_lock_waits |
| RDS for MySQL 8.0 and PolarDB for MySQL 8.0 | performance_schema.data_lock_waits |
For RDS for MySQL 8.0 and PolarDB for MySQL 8.0, enable the performance_schema parameter before using transaction blocking analysis:
For RDS for MySQL: Set instance parameters
For PolarDB for MySQL: Set cluster and node parameters
Trigger methods
Other lock analysis can be triggered in two ways:
| Method | How | Where results appear |
|---|---|---|
| Manual | Trigger on demand from the Lock Analysis page | Lock Analysis page |
| Automatic | Triggered each time the Instance Sessions page is refreshed | Upper-right corner of the Instance Sessions page |
Run a manual analysis
Create an analysis task
Log on to the DAS console.
In the left navigation pane, click Intelligent O &M Center > Instance Monitoring.
Find the target instance and click the instance ID to go to the instance details page.
In the left navigation pane, click Lock Analysis. In the Other Lock Analysis section, click Create Analysis Task.

View analysis results
Click the
icon for a diagnostic result to view metadata lock wait and transaction blocking information.

Transaction lock details
In the transaction lock list, click View Details in the Actions column. The details appear in two modes:
List: Displays blocked transactions as a list.

View: Displays a visual transaction wait relationship graph. Click a session tile to view its details at the bottom of the panel.

Metadata lock details
In the metadata lock list, click View Details in the Actions column. The view displays a session relationship graph. Click a session tile to see its details at the bottom. To resolve a metadata lock wait, kill the blocking session directly from this view.

Investigate Sleep sessions with SQL Explorer and Audit
If a suspicious session is in the Sleep state and no SQL information is available, the session likely has an open transaction whose SQL statements were executed but not yet committed or rolled back.
To investigate:
In the left navigation pane of the instance, click SQL Explorer and Audit.
On the Audit page, click Enable Advanced Query.
Enter the thread ID of the suspicious session to query the SQL statements it executed.
This lets you determine whether the lock wait is caused by an uncommitted transaction.

View automated analysis results
From the Instance Sessions page
Log on to the DAS console.
In the left navigation pane, click Intelligent O &M Center > Instance Monitoring.
Find the target instance and click the instance ID to go to the instance details page.
In the left navigation pane, click Instance Sessions. DAS automatically triggers an analysis and displays results in the upper-right corner of the page.

If a lock wait exists, click View Details. The panel shows transaction locks (if any) and metadata locks (if any).

Transaction lock details
In the transaction lock list, click View Details in the Actions column. The details appear in List and View modes, which work the same way as in manual analysis.

Metadata lock details
In the metadata lock list, click View Details in the Actions column. The relationship graph works the same way as in manual analysis.

From the Lock Analysis page
On the Lock Analysis page, click the
icon for a diagnostic result to view the historical statistics of automated analyses triggered from the Instance Sessions page. The viewing method is the same as for manual analysis.
