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
Situation Awareness
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

GS_SQL_COUNT

Updated on 2023-04-14 GMT+08:00

GS_SQL_COUNT displays statistics about the five types of statements (SELECT, INSERT, UPDATE, DELETE, and MERGE INTO) executed on the current node of the database, including the number of execution times, response time (the maximum, minimum, average, and total response time of the other four types of statements except the MERGE INTO statement, in microseconds), and the number of execution times of DDL, DML, and DCL statements.

The classification of DDL, DML, and DCL statements in the GS_SQL_COUNT view is slightly different from that of the SQL syntaxt. The details are as follows:

  • User-related statements, such as CREATE/ALTER/DROP USER and CREATE/ALTER/DROP ROLE, are of the DCL type.
  • Transaction-related statements such as BEGIN/COMMIT/SET CONSTRAINTS/ROLLBACK/SAVEPOINT/START are of the DCL type.
  • ALTER SYSTEM KILL SESSION is equivalent to the SELECT pg_terminate_backend() statement and is of the DML type.

The classification of other statements is similar to the definition in the SQL syntax.

When a common user queries the GS_SQL_COUNT view, only the statistics of this user in the current node can be viewed. When a user with the administrator permissions queries the GS_SQL_COUNT view, the statistics of all users in the current node can be viewed. When the cluster or the node is restarted, the statistics are cleared and the counting restarts. The counting is based on the number of queries received by the node, including the queries performed inside the cluster. Statistics about the GS_SQL_COUNT view are collected only on CNs, and SQL statements sent from other CNs are not collected. No result is returned when you query the view on a DN.

Table 1 GS_SQL_COUNT columns

Name

Type

Description

node_name

name

Node name

user_name

name

User name

select_count

bigint

Number of SELECT statements

update_count

bigint

Number of UPDATE statements

insert_count

bigint

Number of INSERT statements

delete_count

bigint

Number of DELETE statements

mergeinto_count

bigint

Number of MERGE INTO statements

ddl_count

bigint

Number of DDL statements

dml_count

bigint

Number of DML statements

dcl_count

bigint

Number of DCL statements

total_select_elapse

bigint

Total response time of SELECT statements

avg_select_elapse

bigint

Average response time of SELECT statements

max_select_elapse

bigint

Maximum response time of SELECT statements

min_select_elapse

bigint

Minimum response time of SELECT statements

total_update_elapse

bigint

Total response time of UPDATE statements

avg_update_elapse

bigint

Average response time of UPDATE statements

max_update_elapse

bigint

Maximum response time of UPDATE statements

min_update_elapse

bigint

Minimum response time of UPDATE statements

total_delete_elapse

bigint

Total response time of DELETE statements

avg_delete_elapse

bigint

Average response time of DELETE statements

max_delete_elapse

bigint

Maximum response time of DELETE statements

min_delete_elapse

bigint

Minimum response time of DELETE statements

total_insert_elapse

bigint

Total response time of INSERT statements

avg_insert_elapse

bigint

Average response time of INSERT statements

max_insert_elapse

bigint

Maximum response time of INSERT statements

min_insert_elapse

bigint

Minimum response time of INSERT statements

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