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
Help Center/ TaurusDB/ User Guide/ DBA Assistant/ SQL Analysis and Tunning/ Configuring SQL Statement Concurrency Control

Configuring SQL Statement Concurrency Control

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

Scenarios

SQL statement concurrency control aims to keep TaurusDB instances running stably even if there is a sudden increase in concurrent SQL statements.

Constraints

  • This function is only available to TaurusDB instances that meet the following requirements. For details about how to check the kernel version, see How Can I Check the Version of a TaurusDB Instance?
    • 2.0.28.40 > kernel version ≥ 2.0.28.15
    • Kernel version ≥ 2.0.29.1
  • Concurrency control rules for INSERT statements are only supported when the kernel version of your TaurusDB instance is 2.0.54.240600 or later.
  • A single concurrency control rule can contain a maximum of 128 keywords.
  • Single backslashes (\) or single null characters (' ') cannot be used as keywords.
  • Spaces at the beginning and end of a keyword and special null characters (such as \'t', \'r', and \'n') will be ignored.
  • A concurrency control rule cannot end with a tilde (~).
  • 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.
  • Each SQL concurrency control rule applies to only the SQL statements that your database received after the rule is created.
  • If different rules are created for the primary node and read replicas of a DB instance, the rules still apply to the primary node and read replicas after their roles are switched over.
  • If an SQL statement matches multiple concurrency control rules, only the most recently created rule is applied.
  • SQL statements that have been executed before a concurrency control rule is added are not counted.
  • If the TaurusDB kernel version is 2.0.54.240600 or later, the total length of all rules for SELECT, UPDATE, DELETE, or INSERT statements and the Concurrency value in each rule cannot exceed 4,000 bytes. The length of a single rule cannot exceed 1,000 bytes.
  • If the TaurusDB kernel version is earlier than 2.0.54.240600, the total length of all rules for SELECT, UPDATE, or DELETE statements and the Concurrency value in each rule cannot exceed 1,024 bytes.
  • If there are too many concurrency control rules, performance of SELECT, UPDATE, DELETE, and INSERT statements will deteriorate.
  • SQL concurrency control rules are applied based on prefix match. For example, if the concurrency control rule is SELECT~COUNT~t1, SQL statements SELECT COUNT(*) FROM t1 and SELECT COUNT(*) FROM t1 LIMIT 1 will both be intercepted.
  • After concurrency control is triggered, an execution error is reported on the service side, indicating that query execution was interrupted. The error code is ERROR 1317 (70100).
  • This function controls how many statements can run at the same time. However, it does not limit concurrency for:
    • System tables
    • Queries where no database data is involved, such as select sleep(xxx)
    • Account root
    • SQL statements in stored procedures, triggers, and functions

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > TaurusDB.
  4. On the Instances page, click the instance name.
  5. In the navigation pane, choose DBA Assistant > Historical Diagnosis.
  6. Choose SQL Explorer > Concurrency Control.
  7. On the displayed page, enable Concurrency Control.

    Figure 1 Enabling SQL statement concurrency control

  8. Click Add Rule. In the displayed dialog box, specify SQL Type, Keyword, and Max. Concurrency.

    Figure 2 Adding a concurrency control rule
    • Keyword: You can enter keywords or copy an existing SQL statement to the text box and click Generate Keyword.

      Keyword: Take select~a as an example. select and a are two keywords contained in a concurrency control rule. The keywords are separated by a tilde (~). In this example, the rule restricts the execution of only the SQL statements containing keywords select and a.

    • Max. Concurrency: SQL statements that meet the specified SQL type and keyword and exceed the value of Max. Concurrency will not be executed.
    • If you select Kill existing sessions that match this rule, the sessions that match the rule will be killed.
    • If you select Synchronize rules to other nodes, the new rules can be synchronized to other nodes in the same instance.

  9. Confirm the settings and click OK.
  10. If a concurrency control rule is not required, select the rule and click Delete above the rule list. In the displayed dialog box, 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