Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

PGXC_STAT_ACTIVITY

Updated on 2024-05-07 GMT+08:00

PGXC_STAT_ACTIVITY displays information about the current user's queries on all CNs in the current cluster. Only users with the monitor admin or sysadmin permission can view the view.

Table 1 PGXC_STAT_ACTIVITY columns

Name

Type

Description

coorname

text

Name of a CN in the current cluster.

datid

oid

OID of the database that the user session connects to in the backend.

datname

text

Name of the database that the user session connects to in the backend.

pid

bigint

Backend thread ID.

sessionid

bigint

Session ID.

usesysid

oid

OID of the user logged in to the backend.

usename

text

Name of the user logged in to the backend.

application_name

text

Name of the application connected to the backend.

client_addr

inet

IP address of the client connected to the backend. If this column is null, either the client is connected via a Unix socket on the server machine or this is an internal process such as autovacuum.

client_hostname

text

Host name of the connected client, as reported by a reverse DNS lookup of client_addr. This column will be non-null only for IP connections and only when log_hostname is enabled.

client_port

integer

TCP port number that the client uses for communication with the backend (–1 if a Unix socket is used).

backend_start

timestamp with time zone

Time when this process was started, that is, when the client connected to the server.

xact_start

timestamp with time zone

Time when the current transaction was started (null if no transaction is active). If the current query is the first of its transaction, the value of this column is the same as that of the query_start column.

query_start

timestamp with time zone

Time when the currently active query was started, or if state is not active, when the last query was started.

state_change

timestamp with time zone

Time when state was last changed.

waiting

boolean

Specifies whether the backend is currently waiting for a lock. If yes, the value is true. Otherwise, the value is false.

enqueue

text

Queuing status of a statement. Its value can be:
  • waiting in queue: The statement is in the queue.
  • Empty: The statement is running.

state

text

Overall status of this backend. Its value can be:
  • active: The backend is executing a query.
  • idle: The backend is waiting for a new client command.
  • idle in transaction: The backend is in a transaction, but there is no statement being executed in the transaction.
  • idle in transaction (aborted): The backend is in a transaction, but there are statements failed in the transaction.
  • fastpath function call: The backend is executing a fast-path function.
  • disabled: This state is reported if track_activities is disabled in this backend.
NOTE:

Only system administrators can view the session status of their accounts. The state information of other accounts is empty. For example, after user judy is connected to the database, the state information of user joe and the initial user omm in pgxc_stat_activity is empty.

SELECT datname, usename, usesysid, state,pid FROM pgxc_stat_activity;
 datname  | usename | usesysid | state  |       pid
----------+---------+----------+--------+-----------------
 testdb | omm     |       10 |        | 139968752121616
 testdb | omm     |       10 |        | 139968903116560
 db_tpcds | judy    |    16398 | active | 139968391403280
 testdb | omm     |       10 |        | 139968643069712
 testdb | omm     |       10 |        | 139968680818448
 testdb | joe     |    16390 |        | 139968563377936
(6 rows)

resource_pool

name

Resource pool used by the user.

query_id

bigint

ID of a query.

query

text

Latest query at the backend. If state is active, this column shows the ongoing query. In all other states, it shows the last query that was executed.

connection_info

text

A string in JSON format recording the driver type, driver version, driver deployment path, and process owner of the connected database. For details, see the GUC parameter connection_info.

global_sessionid

text

Global session ID.

unique_sql_id

bigint

Unique SQL statement ID.

trace_id

text

Driver-specific trace ID, which is associated with an application request.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback