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
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

Introduction

Updated on 2022-02-22 GMT+08:00

DDM is compatible with the MySQL license and syntax, but the use of SQL statements is limited due to differences between distributed databases and single-node databases.

Before evaluating a DDM solution, evaluate the compatibility between SQL syntax in your application and syntax supported by DDM.

MySQL EXPLAIN

When you add EXPLAIN before a SQL statement is executed, you will see a specific execution plan. Analyze the time required based on the plan and modify the SQL statement for optimization.

Table 1 Description of the EXPLAIN column

Column Name

Description

table

Table that the data record belongs to

type

Type of the connection. The connections from the best to the worst are const, eq_reg, ref, range, index, and ALL.

possible_keys

Index that may be applied to the table

key

Index that is actually used. If the value is NULL, no index is used. In some cases, MySQL may select indexes that are not fully optimized. Add USE INDEX(indexname) to the SELECT statement to forcibly use an index, or IGNORE INDEX(indexname) to force MySQL to ignore the index.

key_len

Length of the used index. The shorter the length is, the better the index is if accuracy is not affected.

ref

Column where the index is used. The value is generally a constant.

rows

Rows of the data returned by MySQL

Extra

Additional information about how MySQL parses queries

SQL Restrictions

  • Temporary tables are not supported.
  • Foreign keys, views, cursors, triggers, and stored procedures are not supported.
  • Customized data types and functions are not supported.
  • Process control statements such as IF and WHILE are not supported.
  • Compound statements such as BEGIN...END, LOOP...END LOOP, REPEAT...UNTIL...END REPEAT, and WHILE...DO...END WHILE are not supported.

DDL Syntax

  • Sharded and broadcast tables do not support foreign keys.
  • Modifying sharding keys is not supported.
  • ALTER DATABASE Syntax is not supported.
  • Creating sharded or broadcast tables from another table is not supported.
  • The CREATE TABLE statement does not support GENERATED COLUMN.
  • Modifying sharding keys or global sequence fields using the ALTER command is not supported.
  • Creating TEMPORARY sharded or broadcast tables is not supported.
  • The logical table name contains only letters, digits, and underscores (_).
  • CREATE TABLE tbl_name LIKE old_tbl_name is not supported.
  • The CREATE TABLE tbl_name SELECT statement is not supported.
  • Updating the sharding key by executing INSERT INTO ON DUPLICATE KEY UPDATE is not supported.
  • Cross-schema DDL is not supported, for example, CREATE TABLE db_name.tbl_name (... )
  • Reverse quotation marks are required to quote identifiers such as table names, column names, and index names that are MySQL key words or reserved words.

DML Syntax

  • PARTITION clauses are not supported.
  • Nesting a subquery in an UPDATE statement is not supported.
  • INSERT DELAYED Syntax is not supported.
  • STRAIGHT_JOIN and NATURAL JOIN are not supported.
  • Multiple-table UPDATE is supported if all tables joined across shards have primary keys.
  • Multiple-table DELETE is supported if all tables joined across shards have primary keys.
  • Manipulating variables in SQL statements is not supported, for example, SET @c=1, @d=@c+1; SELECT @c, @d.

Unsupported Functions

  • XML functions
  • GTID functions
  • Full-text search functions
  • Enterprise encryption functions
  • Function row_count()

Subqueries

Using subqueries in the HAVING clause and the JOIN ON condition is not supported.

Data Types

Spatial data

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