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

SQL Statement Concurrency Control

Updated on 2025-01-17 GMT+08:00

Concurrency Control restricts the execution of SQL statements based on specified rules when there are SQL statements that cannot be optimized timely or a resource (for example, vCPU) bottleneck occurs.

Usage Notes

  • The kernel version of primary RDS for MySQL instances must be 5.6.50.3, 5.7.31.4, 8.0.25.1, or later.
  • The kernel version of RDS for MySQL read replicas must be 5.6.51.6, 5.7.37.1, 8.0.25.1, or later.
  • Separate concurrency rules can be added for RDS for MySQL read replicas of the kernel version 5.7.38-221000 or later.
  • If a SQL statement matches multiple concurrency control rules, only the latest rule takes effect.
  • Keywords in a concurrency control rule are sorted in a specific order, and the system will match them from first to last. For example, if one rule contains the keyword a~and~b, the system only matches xxx a>1 and b>2.
  • If the replication delay is too long, adding or deleting a concurrency control rule for a read replica does not take effect immediately.
  • If you replicate data from an instance to a third-party instance based on binlogs, deleting or adding SQL statement concurrency rules from or to the instance will interrupt the replication process.
  • Each SQL statement concurrency control rule can contain a maximum of 128 keywords.
  • Currently, SQL Statement Concurrency Control supports only keywords SELECT, UPDATE, and DELETE.
  • Empty characters before and after each keyword will be ignored, for example, spaces, \n, \r, and \t.
  • Too many keywords or rules may affect performance. Retain only required concurrency control rules.
  • Up to 100 concurrency control rules can be retained.
  • If a SQL statement has been stored in query cache, it is not subject to concurrency control.
  • SQL statement concurrency control does not limit concurrency for:
    • System tables
    • SQL statements used to query data, for example, select sleep(xxx)
    • User root in versions including 5.6, 5.7.41.230700 and earlier versions in 5.7, and 8.0.28.230701 and earlier versions in 8.0
    • Stored procedures, triggers, and functions

Procedure

  1. Log in to the Huawei Cloud console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane, choose Intelligent O&M > Instance List.

    Alternatively, on the Overview page, click Go to Intelligent O&M.

  5. In the upper right corner of the Instance List page, search for instances by engine type, instance name, or instance IP.

    Figure 1 Searching for instances

  6. Locate the target instance and click Details.
  7. In the upper right corner of the page, click Go to Old Edition.
  8. Choose SQL > SQL Statement Concurrency Control.
  9. On the displayed page, toggle on Concurrency Control.
  10. Click View Supported Versions.

    Figure 2 Viewing version constraints

  11. Click Add Concurrency Control Rule. In the displayed dialog box, select a SQL statement type, enter keywords, and specify the maximum number of concurrent SQL statements.

    • Keyword: You can enter keywords or copy an existing SQL statement to the text box and click Generate Keyword.
      NOTE:
      • Keywords generated from an original SQL statement are only for reference.
      • Each SQL statement concurrency control rule can contain a maximum of 128 keywords.

      The following explains how a rule matches SQL statements based on keywords:

      For example, if you enter the keywords select~id~name~from~t3~where~age~>~27 (the keywords are separated by a tilde (~)) for a rule, the system will match them from first to last and restrict the execution of any SQL statement that contains these keywords.

    • Max. Concurrency: SQL statements that meet the specified SQL type and keywords and exceed the value of Max. Concurrency will not be executed.
      NOTE:

      SQL statements that have been executed before a concurrency control rule is added are not counted.

      If you add a concurrency control rule and set Max. Concurrency to 0, the concurrency of the following SQL statements will be controlled:

      "select id, name from t3 where age > 27"
      "select id, name, age from t3 where age > 27"
      "select id, name from t3 where age > 5 and id < 27"

      But the concurrency of the following SQL statement will not be controlled:

      "select name, age from t3 where age > 27"

  12. Confirm the settings and click OK.

    If a SQL statement concurrency control rule is no longer needed, click Delete in the Operation column.

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