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
Help Center/ Document Database Service/ User Guide/ Logs/ Slow Query Logs/ Viewing Slow Query Logs on the DDS Console

Viewing Slow Query Logs on the DDS Console

Updated on 2025-02-13 GMT+08:00

Slow query logs record statements that exceed operationProfiling.slowOpThresholdMs (500 seconds by default). You can view log details and statistics to identify statements that are executing slowly and optimize the statements. You can also download slow query logs for service analysis.

Precautions

  • Community Edition instances allow you to view and export log details, enable Show Original Log, and download log files on the management console.
  • The Show Original Log function cannot be enabled when you delete DB instances, add nodes, change DB instance class, rebuild secondary node, or the DB instance is frozen.
  • If Show Original Log is being enabled, you cannot delete instances, add nodes, or change instance class.
  • By default, if the execution time of a SQL statement exceeds 500 ms, a slow query log is recorded.
  • When the size of slow query logs reaches a specified threshold, old data is automatically deleted. If you need to analyze slow query logs, download the logs on the console in a timely manner.
  • You can query slow logs for the last 30 days.
  • You cannot delete slow query logs of DDS.
  • When you export data on the Log Details page, all logs displayed on the current page will be exported.
  • For details about how to sort slow query logs by field, such as execution completion time, SQL statement, client IP address, user, execution duration, lock wait time, scanned documents, returned documents, and scanned indexes, see "Slow Query Logs" in Data Admin Service (DAS) User Guide.
  • Slow query logs may have a delay of several seconds to minutes, depending on the number of generated slow query logs and the DB instance load.
  • In slow query log monitoring, the data of each monitored node is generated based on the total number of slow query logs generated 5 minutes before the time point.
  • To apply for the advanced search permission, submit a service ticket by choosing Service Tickets > Create Service Ticket in the upper right corner of the management console. DB instances of 230830 and later versions support the advanced search function.
  • To apply for the permission to load 500 slow query logs at a time, submit an application by choosing Service Tickets > Create Service Ticket in the upper right corner of the management console. If the node type is set to All nodes or All shards, you are advised to set the query time range to less than 10 minutes.
  • Slow query logs do not have strict consistency. That is, the slow query logs displayed on the page may not include the full slow query logs. The system collects slow query logs periodically. If slow query logs are generated too frequently, the collection period may not cover all slow query logs.

Parameter description

Table 1 Parameters related to DDS slow query logs

Parameter

Description

operationProfiling.slowOpThresholdMs

Queries that exceed the threshold in the unit of ms are deemed slow. The default value is 500 ms.

Unless otherwise specified, keeping the default value is recommended.

Enabling Show Original Log

NOTE:
  • If Show Original Log is enabled, original logs are displayed. By default, the system automatically deletes original logs after 30 days, and the period cannot be changed.
  • If the instance a slow query log belongs to is deleted, related logs are deleted along with it.
  • Show Original Log can be disabled after it is enabled. The slow query logs reported before the function is disabled are displayed. The slow query logs reported after the function is disabled are not displayed.
  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the instance name.
  5. In the navigation pane on the left, choose Slow Query Logs.
  6. On the displayed page, click Slow Query Logs. Then, click on the Log Details tab.

    Figure 1 Enabling Show Original Log

  7. In the displayed dialog box, click Yes to enable the function of slowing original logs.

Viewing and Exporting Log Details

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the instance name.
  5. In the navigation pane on the left, choose Slow Query Logs.
  6. On the Slow Query Logs page, set search criteria on the Log Details tab to view log information.

    Figure 2 Querying slow query logs
    • Log records of all shards of a cluster instance
    • Log records of all nodes in a replica set instance
    • Slow query logs of a node in different time periods
    • Slow query statements of the following levels
      • All statement type
      • INSERT
      • QUERY
      • UPDATE
      • REMOVE
      • GETMORE
      • COMMAND
    • You can view up to 2,000 slow logs of a specified node type, at a specified level, and within a specified period.

  7. On the Log Details tab, click Advanced Search.

    Figure 3 Advanced search
    NOTE:
    • To apply for the advanced search permission, submit a service ticket by choosing Service Tickets > Create Service Ticket in the upper right corner of the management console. DB instances of 230830 and later versions support the advanced search function.

  8. Specify Keyword, Execution Time (ms), Returned Documents, Scanned Documents, Database, Table, Scaned Indexes, Username, and Client IP Address and click Search to view log information.

    Figure 4 Setting advanced search parameters

  9. To clear the parameter settings of Advanced Search, click Reset.

    Figure 5 Resetting advanced search parameters

  10. On the Log Details tab, click in the upper right corner of the log list to export log details.

    • View the .csv file exported to your local PC.
    • Up to 2,000 log details can be exported at a time.

Downloading Logs

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the instance name.
  5. In the navigation pane on the left, choose Slow Query Logs.
  6. On the Slow Query Logs page, click the Log Files tab. Locate a log whose status is Preparation completed and click Download in the Operation column.

    Figure 6 Slow Query Logs
    • The system automatically loads the downloading preparation tasks. The time required depends on the log file size and the network environment.
      • During the downloading preparation, the log status is Preparing.
      • Once the logs are ready for download, the log status changes to Preparation completed.
      • If the downloading preparation fails, the log status is Abnormal.
    • You can download only one log file from a node. The maximum size of a log file to be downloaded is 40 MB.
    • The download link is valid for 5 minutes. After the download link expires, a message is displayed indicating that the download link has expired. To download the log, click OK.

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