The Query Monitoring page displays the real-time information about all queries that are running in a cluster and the historical information about the queries that have been run.
You need to set GUC parameters before viewing data on the monitoring page. If GUC parameters are not set, real-time or historical query may be unavailable. However, if this parameter is set, the cluster performance may deteriorate. Therefore, you need to balance the settings of related parameters. The following table describes recommended settings. For details about how to modify parameters, see "Modifying Database Parameters". Setting GUC Parameters provides parameter details.
GUC Parameter |
CN Configuration |
DN Configuration |
---|---|---|
max_active_statements |
10 |
10 |
enable_resource_track |
on |
on |
resource_track_level |
query |
query |
resource_track_cost |
0 |
0 |
resource_track_duration |
0 |
0 |
enable_resource_record |
on |
on |
session_statistics_memory |
1000MB |
1000MB |
In this area, you can browse the number of queries in different status, including Running, Blocked, Delayed, Canceled, Fast Lane, and Slow Lane.
In the Real-Time Query area, you can browse the real-time information about all running queries, including:
Select a query to be terminated, click Terminate Query, and confirm your operation.
The fine-grained permission control function is added. Only users with the operate permission are able to terminate queries. For users with the read-only permission, the Terminate Query button is grayed out.
In the History area, you can browse all historical query information based on the specified time period, including:
You can click a query ID to view the query details, including the basic information of query statements, real-time and historical resource consumption, SQL description, and query plan.