OceanBase Database supports parallel execution for multiple DDL operations to improve the concurrency performance of databases. In OceanBase Database, you can flexibly control parallel DDL operations, such as CREATE TABLE, TRUNCATE TABLE, COMMENT, DROP TABLE, and CREATE INDEX, by setting parameters _enable_parallel_table_creation and _parallel_ddl_control.
_enable_parallel_table_creation
The _enable_parallel_table_creation parameter specifies whether to enable parallel table creation (CREATE TABLE) at the tenant level.
| Attribute | Description |
|---|---|
| Type | Boolean |
| Default value | True, which specifies to enable parallel table creation. |
| Value range |
|
| Effective mode | The parameter setting takes effect immediately. |
Examples
Execute the following statement in the
systenant to disable parallel table creation for user tenantmysql001:ALTER SYSTEM SET _enable_parallel_table_creation = false tenant=mysql001;Execute the following statement in a user tenant to disable parallel table creation for the tenant:
MySQL mode
ALTER SYSTEM SET _enable_parallel_table_creation = false;Oracle mode:
Note
In Oracle mode, the parameter must be enclosed in double quotation marks in the syntax.
ALTER SYSTEM SET "_enable_parallel_table_creation" = false;
_parallel_ddl_control
The _parallel_ddl_control parameter specifies whether to enable parallel execution of different DDL operations (TRUNCATE TABLE, CREATE INDEX, DROP TABLE, and COMMENT in the current version of OceanBase Database) at the tenant level.
| Attribute | Description |
|---|---|
| Type | String |
| Default value | Empty string, which indicates that the fields corresponding to all DDL operations are set to ON. In this case, parallel execution is supported for all the DDL operations.
NoteIf you explicitly set the fields corresponding to specific DDL operations, the fields corresponding to other DDL operations remain at the default value |
| Value range | Empty string or DDL:{ON | OFF} [, DDL:{ON | OFF}] [, ...]. For more information, see the table below. |
| Effective mode | The parameter setting takes effect immediately. |
The following table describes the parameter values for different types of DDL operations.
| DDL operation | Value |
|---|---|
| TRUNCATE_TABLE | TRUNCATE_TABLE:{ON | OFF} |
| SET_COMMENT | SET_COMMENT:{ON | OFF} |
| CREATE_INDEX | CREATE_INDEX:{ON | OFF} |
| DROP_TABLE | DROP_TABLE:{ON | OFF} |
Notice
The current version of OceanBase Database does not support parallel creation of global indexes, multi-valued indexes, or vector indexes.
Examples
Execute the following statement in the
systenant to disable parallel table truncation and enable parallel index creation for 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 table truncation and enable parallel index creation for the tenant:
MySQL mode:
ALTER SYSTEM SET _parallel_ddl_control = 'CREATE_INDEX:ON, TRUNCATE_TABLE:OFF';Oracle mode:
Note
In Oracle mode, hidden parameters need to be enclosed with double quotation marks (" ") in terms of the syntax.
ALTER SYSTEM SET "_parallel_ddl_control" = 'CREATE_INDEX:ON, TRUNCATE_TABLE:OFF';