Real-Time Queries

Going to the Real-time Query Page

  1. Log in to the GaussDB(DWS) console.
  2. On the Clusters > Dedicated Clusters page, locate the cluster to be monitored.
  3. In the Operation column of the target cluster, click Monitoring Panel.
  4. In the navigation pane, choose Monitoring > Queries.

    You can check the real-time information about all queries and sessions running in the cluster.

  • Real-time query is supported only in clusters of version 8.1.2 and later.
  • To enable real-time query monitoring, choose Settings > Monitoring, click Monitoring Collection, and enable Real-Time Query Monitoring. For details, see Monitoring Collection. Enabling real-time query may cause a large amount of data. Exercise caution when performing this operation.

Prerequisites

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 how to modify parameters, see "Modifying Database Parameters". Setting GUC Parameters provides parameter details.

Table 1 Recommended GUC parameter settings

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

10

10

enable_resource_record

on

on

session_statistics_memory

1000MB

1000MB

Querying Information

You can view the queries statistics, the number of sessions, average session duration (time of all session connections divided by the number of sessions), number of queries, average query duration, and average query waiting time.

Checking Live Sessions

On the Sessions tab, you can browse the real-time information about all running queries,

Checking Real-time Queries

On the Queries tab, you can browse all the queries that are running in a specified time period, including:

Viewing Real-time Query Monitoring Details

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.