tencent cloud

TDSQL-C for MySQL

Release Notes and Announcements
Release Notes
Product Announcements
Beginner's Guide
Product Introduction
Overview
Strengths
Use Cases
Architecture
Product Specifications
Instance Types
Product Feature List
Database Versions
Regions and AZs
Common Concepts
Use Limits
Suggestions on Usage Specifications
Kernel Features
Kernel Overview
Kernel Version Release Notes
Optimized Kernel Version
Functionality Features
Performance Features
Security Features
Stability Feature
Analysis Engine Features
Inspection and Repair of Kernel Issues
Purchase Guide
Billing Overview
Product Pricing
Creating Cluster
Specification Adjustment Description
Renewal
Payment Overdue
Refund
Change from Pay-as-You-Go to Yearly/Monthly Subscription
Change from Pay-as-You-Go to Serverless Billing
Value-Added Services Billing Overview
Viewing Billing Statements
Getting Started
Database Audit
Overview
Viewing Audit Instance List
Enabling Audit Service
Viewing Audit Logs
Log Shipping
Post-Event Alarm Configuration
Modifying Audit Rule
Modifying Audit Service
Disabling Audit Service
Audit Rule Template
Viewing Audit Task
Authorizing Sub-User to Use Database Audit
Serverless Service
Serverless Introduction
Creating and Managing a Serverless Cluster
Elastic Scaling Management Tool
Serverless Resource Pack
Multi-AZ Deployment
Configuration Change
FAQs
Serverless Cost Estimator
Operation Guide
Operation Overview
Switching Cluster Page View in Console
Database Connection
Instance Management
Configuration Adjustment
Instance Mode Management
Cluster Management
Scaling Instance
Database Proxy
Account Management
Database Management
Database Management Tool
Parameter Configuration
Multi-AZ Deployment
GD
Backup and Restoration
Operation Log
Data Migration
Parallel Query
Columnar Storage Index (CSI)
Analysis Engine
Database Security and Encryption
Monitoring and Alarms
Basic SQL Operations
Connecting to TDSQL-C for MySQL Through SCF
Tag
Practical Tutorial
Classified Protection Practice for Database Audit of TDSQL-C for MySQL
Upgrading Database Version from MySQL 5.7 to 8.0 Through DTS
Usage Instructions for TDSQL-C MySQL
New Version of Console
Implementing Multiple RO Groups with Multiple Database Proxy Connection Addresses
Strengths of Database Proxy
Selecting Billing Mode for Storage Space
Creating Remote Disaster Recovery by DTS
Creating VPC for Cluster
Data Rollback
Solution to High CPU Utilization
How to Authorize Sub-Users to View Monitoring Data
White Paper
Security White Paper
Performance White Paper
Troubleshooting
Connection Issues
Performance Issues
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Multi-Availability Zone APIs
Other APIs
Audit APIs
Database Proxy APIs
Backup and Recovery APIs
Parameter Management APIs
Billing APIs
serverless APIs
Resource Package APIs
Account APIs
Performance Analysis APIs
Data Types
Error Codes
FAQs
Basic Concepts
Purchase and Billing
Compatibility and Format
Connection and Network
Features
Console Operations
Database and Table
Performance and Log
Database Audit
Between TDSQL-C for MySQL and TencentDB for MySQL
Service Agreement
Service Level Agreement
Terms of Service
TDSQL-C Policy
Privacy Policy
Data Privacy and Security Agreement
General References
Standards and Certifications
Glossary
Contact Us
DocumentationTDSQL-C for MySQLOperation GuideOperation LogQuerying and Downloading Slow Log Details

Querying and Downloading Slow Log Details

PDF
Focus Mode
Font Size
Last updated: 2026-01-29 18:16:19
The slow log is used to record query statements that take more time than the specified value to execute in TDSQL-C for MySQL read-write and read-only instances. You can find out inefficient query statements to optimize by slow log details. TDSQL-C for MySQL allows you to download such details for easier analysis and optimization.
This document describes how to query and download slow log details.

Querying Slow Logs

1. On the cluster list page, follow the steps below to enter the cluster management page based on the actual view mode.
Tab View
List view
Log in to the TDSQL-C for MySQL console, and click the target cluster in the cluster list on the left to enter the cluster management page.
1. log in to the TDSQL-C for MySQL console.
2. Select a region at the top, locate the cluster for which you want to query or download slow logs, and click the Cluster ID or Manage in the Operation column to enter the cluster management page.
2. On the cluster management page, select the Operation Log tab, choose the target instance, and then click Slow Log Details .

In the slow log details list, you can query the details of all slow logs or logs of today, yesterday, the last 7 days, the last 30 days, or a custom time range.
You can query slow log details by key fields (client address, username, and database name) to quickly obtain target slow logs, and you can export them into a list file.
In the slow log details list, you can view detailed information. For specific fields, refer to Slow Log Fields.
Note:
To view the following 7 fields: number of remote reading times, number of remote read bytes, time spent on remote reading (ns), number of remote writing times, number of remote written bytes, time spent on remote writing (ns), and transaction submission delay (μs), your kernel version should be TXSQL 8.0 with a kernel minor version of 3.1.12 or later. To display them in the slow log list, you can click the setting icon on the right, select the fields you want to view, and click OK .

When you download slow log details using the Export feature, all fields will be included in the downloaded details, even if not all fields are selected in the settings.

Slow Log Fields

Field
Description
Execution Time
Time of execution, for example, 2024/9/22 23:56:12.
SQL Statement
The executed SQL statement, for example, DROP DATABASE IF EXISTS db1.
Client Address
The client address where an operation was executed, for example, 172...10.
Username
The username used to perform an operation, for example, root.
Database
Database name, for example, mysql.
Duration (sec)
SQL execution time, in seconds.
Lock Time (sec)
Total time taken during an operation, from waiting for a lock to acquiring it and completing the operation, in seconds.
Parsed Rows
Number of rows successfully parsed and processed during a query or an operation.
Returned Rows
Number of rows actually returned to a client after a query or an operation.
Number of remote reading times
Number of times data is read from the storage layer during a query or an operation.
Number of remote read bytes
Amount of data read from the storage layer during a query or an operation, in bytes.
Time spent on remote reading (ns)
Time taken to read data from the storage layer during a query or an operation, in nanoseconds.
Number of remote writing times
Number of times data is written to the storage layer during a write operation.
Number of remote written bytes
Amount of data written to the storage layer during a query or an operation, in bytes.
Time spent on remote writing (ns)
Time taken to write data to the storage layer during a query or an operation, in nanoseconds.
Transaction submission delay (μs)
Time elapsed from the beginning of a transaction submission to its actual completion, in microseconds.

Downloading Slow Log Details

On the cluster list page, proceed based on the actual view mode.
Tab View
List View
1. Log in to the TDSQL-C for MySQL console, and click the target cluster in the cluster list on the left to enter the cluster management page.
2. On the cluster management page, select the Operation Log tab, choose the target instance, and then click Slow Log Details .
3. Query the target slow log details by time or keyword, and then click Export .

4. In the pop-up window, select a file format, and click OK for local download.

You can export the filtered or retrieved results. Export formats include CSV and native format (supported by open-source analysis tools).
Exporting in CSV format allows for quick check and optimization, making it user-friendly. An example of the exported information is as follows:

Exporting in native format allows for recognition by open-source analysis tools. An example of the exported information is as follows:

You can export up to 2,000 records at a time. To download more than 2,000 records, select a shorter time range and export a part of the records you need. Repeat the steps until all of the records are exported.
1. Log in to the TDSQL-C for MySQL console.
2. Select a region at the top, locate the cluster for which you want to query or download slow logs, and click the cluster ID or Manage in the Operation column to enter the cluster management page.
3. On the cluster management page, select the Operation Log tab, choose the target instance, and then click Slow Log Details .
4. Query the target slow log details by time or keyword, and then click Export .
5. In the pop-up window, select a file format, and click OK for local download.

You can export the filtered or retrieved results. Export formats include CSV and native format (supported by open-source analysis tools).
Exporting in CSV format allows for quick check and optimization, making it user-friendly. An example of the exported information is as follows:

Exporting in native format allows for recognition by open-source analysis tools. An example of the exported information is as follows:

You can export up to 2,000 records at a time. To download more than 2,000 records, select a shorter time range and export a part of the records you need. Repeat the steps until all of the records are exported.

Related APIs

API
Description
This API (DescribeInstanceSlowQueries) is used to query the instance slow log details.
This API (ExportInstanceSlowQueries) is used to export instance slow logs.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback