The transaction analysis feature lets you retrieve the type, count, and details of transactions for a specific thread within a selected time range. Use it to understand, analyze, and optimize database performance from a transaction perspective.
How it works
Transaction analysis uses data from the hot storage of DAS Enterprise Edition V3 or Compliance Audit Edition. For a selected thread and time range, it analyzes transaction details, runs a statistical analysis, and plots a trend chart showing the count of each transaction type.

A single transaction can be classified into multiple types. For example, a transaction can be both an implicitly submitted transaction and a long-running transaction.
The following transaction types are supported:
-
Normal transaction.
-
Implicitly submitted transaction.
-
Large transaction: a transaction that updates more than 10,000 rows.
-
Long-running transaction: a transaction that lasts for more than 10 minutes.
-
Transaction with a long pause: a transaction that pauses for more than 1 minute.
-
Transaction with too many statements: a transaction that contains more than 100 SQL statements. The count includes only update-related SQL statements: INSERT, UPDATE, DELETE, MERGE, CREATE, ALTER, DROP, SET, REPLACE, and RENAME.
-
Boundary transaction: a transaction whose end statement falls outside the analysis time range.
Prerequisites
-
The target database engine is one of the following:
-
ApsaraDB RDS for MySQL
-
PolarDB for MySQL
-
-
The database instance is connected to DAS and shows a status of Normal Connection.
-
The database version and region support DAS Enterprise Edition V3 or Compliance Audit Edition. For more information, see Editions and supported features.
-
The instance must have DAS Enterprise Edition V3 or Compliance Audit Edition enabled. For more information, see Introduction to DAS audit logs.
Use cases
-
Analyze transactions on threads causing deadlocks to resolve deadlock issues and improve database performance. Use this in conjunction with the lock analysis overview and its Deadlock Analysis feature.
-
Analyze the source transactions causing blocking to resolve and optimize lock wait issues. Use this in conjunction with lock analysis and its transaction blocking analysis feature.
-
Analyze transactions on the thread that is running a specific SQL statement you are investigating. Use this in conjunction with audit logs.
Limitations
-
Only SQL data within the hot storage time range of DAS Enterprise Edition V3 or Compliance Audit Edition can be analyzed.
Note-
You can modify the hot storage duration for DAS Enterprise Edition V3 or Compliance Audit Edition by clicking Service Settings in the upper-right corner of the SQL Explorer and Audit page.
-
Hot storage incurs costs. For more information, see Billing details.
-
-
Only one running transaction analysis task is allowed per instance.
-
Each transaction analysis task can analyze transactions for up to two threads.
-
Each transaction analysis task can analyze data for up to 30 minutes.
Procedure
-
Log on to the DAS console.
-
In the navigation pane on the left, click .
-
Find the target instance and click the instance ID to open the instance details page.
-
In the left-side navigation pane, click Request Analysis > SQL Explorer and Audit. On the page that appears, click the SQL Explorer tab and then the Transaction Analysis tab.
-
Create a transaction analysis task
Click Create Analysis, select the time range for the analysis, enter one or two thread IDs, and create the task. You can view the created analysis tasks in the Transaction Analysis List.
The Analysis Range supports the quick options Last 10 minutes, Last 15 minutes, and Last 30 minutes. Transaction analysis supports only hot data analysis, so you must select a time range within your hot storage retention period. You can enter a maximum of two thread IDs.
NoteEnter a valid thread ID. You can obtain thread IDs from pages such as lock analysis, the audit logs list, and Instance Sessions.
-
View transaction analysis results
You can filter the task list by time to view transaction analysis records from a specific period.
-
In the Transaction Analysis List, find the target analysis task and click View Details in the Actions column to view the trend chart of transaction counts by type and the transaction list.
-
In the Transaction Overview section, hover over a bar in the chart to view the list of transactions that started within that minute. Click View Details for a specific transaction to view its underlying SQL statements.
ImportantYou can query SQL details only for data within the hot storage time range.
-
-