Use these parameters to control how the data definition language (DDL) execution engine runs in PolarDB-X 1.0. Each parameter can be applied at the database, session, or statement level.
Parameters
| Parameter | Type | Scope | Default | Range |
|---|---|---|---|---|
| ENABLE_ASYNC_DDL | Boolean | Database, statement | TRUE | TRUE, FALSE |
| PURE_ASYNC_DDL_MODE | Boolean | Database, session, statement | FALSE | TRUE, FALSE |
| MAX_TABLE_PARTITIONS_PER_DB | Integer | Database, statement | 128 | 1–65535 |
ENABLE_ASYNC_DDL
Type: Boolean
Scope: Database, statement
Default: TRUE
Values: TRUE, FALSE
When set to TRUE (the default), PolarDB-X 1.0 uses the new DDL execution engine, and both PURE_ASYNC_DDL_MODE and MAX_TABLE_PARTITIONS_PER_DB are active.
When set to FALSE, PolarDB-X 1.0 reverts to the DDL execution engine from versions earlier than v5.3.12. In this state, PURE_ASYNC_DDL_MODE and MAX_TABLE_PARTITIONS_PER_DB have no effect. Before setting this parameter to FALSE, submit a ticket to confirm whether this change is appropriate for your environment.
Set ENABLE_ASYNC_DDL
Database level
On the Parameter Settings page in the PolarDB-X 1.0 console, update the parameter value. The change applies to the entire database. For details, see Set parameters.
Statement level
Add a hint at the beginning of the DDL statement. The parameter applies only to that statement.
/*+TDDL:cmd_extra(ENABLE_ASYNC_DDL=FALSE)*/ ALTER TABLE ...PURE_ASYNC_DDL_MODE
Type: Boolean
Scope: Database, session, statement
Depends on:
ENABLE_ASYNC_DDL=TRUEDefault: FALSE
Values: TRUE, FALSE
Controls whether the client waits for a DDL job to complete before receiving a response.
| Value | Behavior | Use when |
|---|---|---|
| FALSE (default) | Synchronous blocking mode. The client receives a response after the DDL job completes. If the client disconnects, the running DDL job may be interrupted. | DDL operations must be compatible with ApsaraDB RDS for MySQL, or when you want the client to confirm completion before continuing. |
| TRUE | Asynchronous mode. The client receives a response as soon as the DDL request is accepted; the job continues in the background. Run SHOW DDL to check job status. For details, see Job management statements. | The client may disconnect unexpectedly, or when you want long-running DDL jobs to complete without holding a connection. |
Set PURE_ASYNC_DDL_MODE
Database level
On the Parameter Settings page in the PolarDB-X 1.0 console, update the parameter value. The change applies to the entire database. For details, see Set parameters.
Session level
Run the following statements after connecting to PolarDB-X 1.0.
Enable asynchronous mode for the current session:
SET PURE_ASYNC_DDL_MODE = true;
-- or
SET PURE_ASYNC_DDL_MODE = 1;Restore synchronous mode for the current session:
SET PURE_ASYNC_DDL_MODE = false;
-- or
SET PURE_ASYNC_DDL_MODE = 0;Statement level
Add a hint at the beginning of the DDL statement. The parameter applies only to that statement.
/*+TDDL:cmd_extra(PURE_ASYNC_DDL_MODE=TRUE)*/ ALTER TABLE ...MAX_TABLE_PARTITIONS_PER_DB
Type: Integer
Scope: Database, statement
Depends on:
ENABLE_ASYNC_DDL=TRUEDefault: 128
Range: 1–65535
Sets the maximum number of table shards allowed in a single physical database. If a DDL job would cause the shard count to exceed this limit, the job stops and an error is reported.
Set MAX_TABLE_PARTITIONS_PER_DB
Database level
On the Parameter Settings page in the PolarDB-X 1.0 console, update the parameter value. The change applies to the entire database. For details, see Set parameters.
Statement level
Add a hint at the beginning of the DDL statement. The parameter applies only to that statement.
/*+TDDL:cmd_extra(MAX_TABLE_PARTITIONS_PER_DB=400)*/ CREATE TABLE ...What's next
Set parameters — view and modify database and instance parameters in the console
Job management statements — query DDL job status, and resume or roll back failed jobs