Quick Start
Cluster Deployment
Data Model
Data Writing
Data Query
SQL Reference
Maintenance and Monitoring
Tool Guide
Troubleshooting
FAQ
This document describes how to use the YMatrix graphical interface to analyze and manage active and blocked queries in the database.
During business operations, YMatrix often executes a large number of queries. To facilitate daily monitoring of query execution status, the query monitoring feature provides real-time information about active and blocked queries. This helps users manage and analyze slow queries and query blocking scenarios, thereby improving database service efficiency.
A slow query is an SQL statement whose execution time exceeds a specified threshold. Slow queries are major contributors to database performance degradation and are key targets for optimizing database access. The query monitoring interface displays current slow queries that meet specified conditions, helping you manage and analyze them to improve database efficiency.
First, log in to the graphical interface. Enter the IP address (by default, the Master host IP) and port number of the machine where MatrixGate is running into your browser:
http://<IP>:8240
After logging in, click Query Monitoring in the left navigation panel to access the Active Sessions page.
pg_stat_activity. By default, results are sorted in descending order by query_start time. The list refreshes automatically every 10 seconds. If you need to examine a specific entry in detail, you can pause auto-refresh to prevent the session you are viewing from being filtered out. To reduce system load caused by frequent refreshes, auto-refresh will be suspended when you exit the query monitoring page.active + idle in transaction by default. You can click any status on the state bar to filter the list. Each status block shows the count of 状态+ 处于该状态的会话数量.Explanation of
idle in transaction
This status indicates that the SQL statement has completed execution, but the corresponding transaction has not yet been committed or rolled back. Although queries in this state do not consume CPU or I/O resources, they occupy connection and concurrency limits. Additionally, all locks held by queries within the transaction remain active until the transaction is committed or rolled back. During this period, most queries involving tables affected by the transaction will be blocked, which may degrade service response time.
If a transaction remains inidle in transactionstate for an extended period (e.g., over one hour), it is recommended to commit or roll back the transaction promptly.

Click the View button on the right side of the target session to open the query details dialog. This page displays all field information of the query from the pg_stat_activity table and supports terminating the session.

Click Blocked Sessions to switch to the blocked session list. This page shows current session blocking relationships in the database, sorted in descending order by blocking duration—longer-standing blocking relationships appear at the top. The list refreshes automatically every 10 seconds. To carefully inspect a specific blocking relationship, you can pause auto-refresh to avoid losing the current view due to updates. Auto-refresh is suspended when you leave the query monitoring page to reduce system load.

Click the View button on the right side of a blocking relationship to open the details dialog, which allows you to terminate the session.
