OceanBase AI Database supports parallel DDL operations to improve the execution efficiency of DDL statements.
Configure parallel DDL
In OceanBase AI Database, you can flexibly control the parallel DDL feature by configuring the following parameters:
_enable_parallel_table_creation: controls parallelCREATE TABLEoperations._parallel_ddl_control: controls the following parallel operations:TRUNCATE TABLEDROP TABLECREATE INDEXCREATE VIEWCOMMENT
_enable_parallel_table_creation
_enable_parallel_table_creation specifies whether to enable concurrent table creation (CREATE TABLE) at the tenant level.
Attribute |
Description |
|---|---|
| Parameter type | Boolean |
| Default value | True, indicating that concurrent table creation is enabled. |
| Value range |
|
| Effective mode | Effective immediately |
Examples
Execute the following statement in the
systenant to disable concurrent table creation for the user tenantmysql001.ALTER SYSTEM SET _enable_parallel_table_creation = false tenant=mysql001;Execute the following statement in a user tenant to disable concurrent table creation.
ALTER SYSTEM SET _enable_parallel_table_creation = false;ALTER SYSTEM SET "_enable_parallel_table_creation" = false;
_parallel_ddl_control
_parallel_ddl_control specifies whether to enable various parallel DDL features at the tenant level. In the current version of OceanBase AI Database, this parameter controls the switches for the parallel features of TRUNCATE TABLE, CREATE INDEX, CREATE VIEW, DROP TABLE, and COMMENT.
Attribute |
Description |
|---|---|
| Parameter type | STRING |
| Default value | Empty string. The semantics are as follows:
NoteFor individual parallel DDL operations, DDL types other than |
| Value range | An empty string, or DDL:{ON | OFF} [, DDL:{ON | OFF}] [, ...]. For details about DDL type information, see the table below. |
| Effective mode | Effective immediately |
DDL type information:
DDL type |
Valid values |
|---|---|
| TRUNCATE_TABLE | TRUNCATE_TABLE:{ON | OFF} |
| SET_COMMENT | SET_COMMENT:{ON | OFF} |
| CREATE_INDEX | CREATE_INDEX:{ON | OFF} |
| CREATE_VIEW | CREATE_VIEW:{ON | OFF} |
| DROP_TABLE | DROP_TABLE:{ON | OFF} |
Notice
The current version of OceanBase AI Database does not support concurrent execution of full-text indexes, multi-valued indexes, and vector indexes.
Examples
Execute the following statement in the
systenant to enable parallelTRUNCATE TABLEand disable parallelCREATE INDEXfor the user tenantmysql001.ALTER SYSTEM SET _parallel_ddl_control = 'CREATE_INDEX:ON, TRUNCATE_TABLE:OFF' tenant = 'mysql001';Execute the following statement in a user tenant to disable parallel
TRUNCATE TABLEand enable parallelCREATE INDEX.ALTER SYSTEM SET _parallel_ddl_control = 'CREATE_INDEX:ON, TRUNCATE_TABLE:OFF';ALTER SYSTEM SET "_parallel_ddl_control" = 'CREATE_INDEX:ON, TRUNCATE_TABLE:OFF';
Default DDL parallelism
In OceanBase AI Database, you can use the session-level parameter _force_parallel_ddl_dop to specify the default parallelism for DDL operations.
Note
If the parallelism is not explicitly specified using the PARALLEL hint, DDL will use the value set by _force_parallel_ddl_dop.
When using the parallel DDL feature, you can pre-set the parallelism for DDL execution via _force_parallel_ddl_dop.
Example
Execute the following statement in a user tenant to set the default parallelism for session-level DDL operations to 16.
SET _FORCE_PARALLEL_DDL_DOP = 16;
SET "_FORCE_PARALLEL_DDL_DOP" = 16;