Introduction

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 selecting a DDM solution, evaluate the SQL syntax compatibility between your application and DDM.

MySQL EXPLAIN

If you add EXPLAIN before a SQL statement, you will see a specific execution plan when you execute the statement. You can 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 row of data belongs to

type

Type of the connection. Connection types 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 choose to optimize indexes, for example, force MySQL to use an index by adding USE INDEX(indexname) to a SELECT statement or to ignore an index by adding IGNORE INDEX(indexname).

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

DDL Syntax

DML Syntax

Unsupported Functions

Subqueries

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

Data Types

Spatial data types are not supported.