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

SQL Diagnosis

Updated on 2022-08-16 GMT+08:00

Prerequisites

To enable SQL diagnosis, enable monitoring on real-time and historical queries on the Queries and History tabs, respectively. For details, see .

Viewing SQL Diagnosis

  1. Log in to the GaussDB(DWS) management console.
  2. On the Clusters page, locate the target cluster.
  3. In the Operation column of the target cluster, click Monitoring Panel.
  4. In the navigation pane on the left, choose Utilities > SQL Diagnosis. The metrics include:

    • Query ID
    • Database
    • Schema Name
    • User Name
    • Client
    • Client IP Address
    • Running Time (ms)
    • CPU Time (ms)
    • Scale-Out Started
    • Completed
    • Details

  5. On the SQL Diagnosis page, you can view the SQL diagnosis information. In the Details column of a specified query ID, click View to view the detailed SQL diagnosis result, including:

    • Diagnosis Type
    • Alarm Information
    • SQL Statement
    • Execution Plan

Setting GUC Parameters

GUC parameters related to SQL diagnosis are as follows. For details, see "GUC Parameters" in the Data Warehouse Service (DWS) Developer Guide.

  • enable_resource_track
    • Value range: boolean
    • Default value: on
    • Expected DMS value: on (for reference only)
    • Function: Specifies whether to enable the real-time resource monitoring function.
      NOTICE:

      If this parameter is enabled without other GUC-related parameters correctly configured, real-time resource consumption cannot be recorded.

  • resource_track_cost
    • Value range: an integer ranging from –1 to INT_MAX
    • Default value: 100000
    • Expected DMS value: 0 (for reference only)
    • Function: Specifies the minimum execution cost of statement resource monitoring for the current session. This parameter is valid only when enable_resource_track is on.
      NOTICE:

      If this parameter is set to a small value, more statements will be recorded, causing record expansion and affecting cluster performance.

  • resource_track_level
    • Value range: enumerated type
    • Default value: query
    • Expected DMS value: query (for reference only)
    • Function: Specifies the resource monitoring level for the current session. This parameter is valid only when enable_resource_track is on.
      NOTICE:

      If the resource monitoring is set to operator-level, performance will be greatly affected.

  • resource_track_duration
    • Value range: an integer ranging from 0 to INT_MAX, in seconds
    • Default value: 60.
    • Expected DMS value: 0 (for reference only)
    • Function: Specifies the minimum statement execution time that determines whether information about jobs of a statement recorded in the real-time view will be dumped to a historical view after the statement is executed. That is, only statements whose execution time exceeds the specified time are recorded in the historical view. This parameter is valid only when enable_resource_track is on.
      NOTICE:

      If this parameter is set to a small value, the batch processing mechanism for dumping kernel statements becomes invalid, affecting the kernel performance.

  • topsql_retention_time
    • Value range: an integer ranging from 0 to 3650, in days
    • Default value: 0
    • Expected DMS value: 1 (for reference only)
    • Function: Specifies the aging time of pgxc_wlm_session_info data in the view.
      NOTICE:

      If this parameter is set to 0, data will not be aged, which will cause storage expansion.

  • enable_resource_record
    • Value range: boolean
    • Default value: off
    • Expected DMS value: on (for reference only)
    • Function: Specifies whether to enable the archiving function for resource monitoring records. When this function is enabled, records in the history views (GS_WLM_SESSION_HISTORY and GS_WLM_OPERATOR_HISTORY) are archived to the info views (GS_WLM_SESSION_INFO and GS_WLM_OPERATOR_INFO) every 3 minutes. After the archiving, records in the history views are deleted.
      NOTICE:

      When this parameter is enabled, you are advised to set topsql_retention_time properly to configure the aging time. Otherwise, data in the GS_WLM_SESSION_INFO or GS_WLM_OPERATOR_INFO table will expand.

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