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 MySQLKernel FeaturesOptimized Kernel VersionCompilation Optimization High-Performance Version

Compilation Optimization High-Performance Version

PDF
Focus Mode
Font Size
Last updated: 2025-12-24 15:22:30
The TXSQL kernel of TencentDB for MySQL supports a compilation optimization high-performance version, which can maintain the original compatibility without changing the internal implementation logic of the kernel. By leveraging dynamic compiler optimization techniques to identify possible user input behavior, the database kernel demonstrates stronger performance in common business scenarios, while also reducing power consumption. This article introduces the compilation optimization high-performance version of TencentDB for MySQL.

Supported Versions

TDSQL-C for MySQL 5.7 (kernel version 2.1.11) or later.
TDSQL-C for MySQL 8.0 (kernel version 3.1.12) or later.
Note:
The compilation optimization high-performance version is currently in grayscale release. If you want to experience it in advance, please submit a ticket to apply for use under the precondition of meeting the above database kernel version requirements.

Overview

As the internal implementation of modern CPUs becomes increasingly complex, the default compilation, configuration, and execution methods of cloud databases can hardly fully exploit the performance potential of CPUs, leading to a significant number of CPU cycles idling. This phenomenon, in the case of the compunded scale effect, not only results in the wastage of hardware resources but also consumes a lot of power. Therefore, it is necessary to optimize cloud databases to maximize the performance potential of CPUs, reduce the idling of CPU cycles, improve the utilization rate of hardware resources, and decrease power consumption waste.
TDSQL-C for MySQL, without changing the database kernel's business logic code precondition, employs dynamic compiler optimization techniques to achieve kernel performance improvement and power consumption reduction with minimal cost. By collecting behavior and performance consumption data of cloud databases in typical/real business scenarios, it improves the default compilation method being unaware of business behavior, analyzes the database runtime behavior characteristics along with the CPU microarchitecture features, and utilizes compilation optimization technologies to make the optimized version more friendly to the CPU microarchitecture, fully unleashing the CPU's performance potential; and ensures the optimization effect does not degrade under various conditions through extensive scenario testing.
The following optimizations were achieved through the above technical measures:
1. Based on database operation behavior data, feedback optimization improves the optimization capabilities of function inlining/function reordering/basic library reordering, thereby significantly reducing database CPU ICache/ITLB miss rates and enhancing performance.
2. By utilizing link-time optimization techniques, the compilation optimization perspective is expanded from a single file/single function to across files/entire binary files, significantly enhancing the optimization space for inlining and reducing the directive count.
3. In practice, a set of efficient verification and analysis methods has been developed to ensure the effects are close to theoretical thresholds and guarantee no degradation under various scenarios.


Definition of Compilation Optimization

Compilation optimization refers to the process of enhancing a program's execution efficiency and performance by optimizing the code and adjusting compilation parameters during code compilation.

Optimization Principles

The high-performance version of TDSQL-C for MySQL uses Profile-Guided Optimization (PGO) technology for compilation optimization. PGO technology addresses the issue that traditional compilers, during optimization, rely solely on static code information without considering potential user inputs, thus failing to effectively optimize the code.
PGO technology is divided into the following three stages:
1. Instrument: During the instrument stage, an initial compilation is performed on the application. In this compilation, the compiler inserts directives into the code so that data can be collected in the next stage. These directives are of three types, used to track how many times each function is executed, how many times each branch is executed (for example, in if-else scenarios), and certain variable values (primarily for switch-case scenarios).
2. Train: In the train stage, users need to run the application compiled in the previous stage using the most common inputs. Since the previous stage has prepared for data collection, the data corresponding to the most common usage scenarios of that application will be collected after the train stage.
3. Optimization: In the optimization stage, the compiler recompiles the application using the data collected in the previous stage. Since the data from the previous stage comes from the most common user input scenarios, the final optimized result will perform better in these scenarios.
Through the optimization of these three stages, the high-performance version of TDSQL-C for MySQL can better meet the needs of users, improving the performance and efficiency of the application.

Performance Testing

For details about the performance test data on the compilation-optimized high-performance version, see the following documents.

Help and Support

Was this page helpful?

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

Feedback