tencent cloud

TDSQL Boundless

Online DDL Overview

Download
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-07-13 17:25:18
This document describes TDSQL Boundless's support for Online DDL. TDSQL Boundless already supports most Online DDL, including some Inplace DDL that only require metadata modification.

Support for Online DDL

Secondary Index Operations

Operation
Syntax Supported
Online Change
Reason for Not Supporting Online Change
Metadata-Only
Data Operation
Permits Concurrent DML
Creating/Adding a secondary index
Yes
Yes
/
No
Requires data backfill
Yes
Dropping an index
Yes
Yes
/
No
Async data deletion
Yes
Renaming an index
Yes
Yes
/
No
/
Yes
Adding a FULLTEXT index
No
No
Not support this operation
/
/
/
Adding a SPATIAL index
No
No
Not support this operation
/
/
/
Changing the index type
No
No
The engine only supports regular indexes and does not support B-tree/Hash, or other types.
/
/
/

Primary Key Operations

DDL operations that modify a primary key are not supported in online mode. They require locking the table and performing a full copy.
Operation
Syntax Supported
Online Change
Reason for Not Supporting Online Change
Metadata-Only
Data Operation
Permits Concurrent DML
Adding a primary key
Yes
No
Data reorganization is required.
No
Requires table lock and copy
No
Dropping a primary key
Yes
No
Data reorganization is required.
No
Requires table lock and copy
No
Dropping a primary key and adding another
Yes
Yes
/
No
Requires table lock and copy
Yes

Column Operations

Operation
Syntax Supported
Online Change
Reason for Not Supporting Online Change
Metadata-Only
Data Operation
Permits Concurrent DML
Adding a column
(at the end)
Yes
Yes
/
Yes
/
Yes
Adding a column
(not at the end)
Yes
Yes
/
No
Requires Online Copy
Yes
Dropping a column
Yes
Yes
/
No
Requires Online Copy
Yes
Renaming a column
Yes
Yes
/
Yes
/
Yes
Reordering columns
Yes
Yes
/
No
Requires Online Copy
Yes
Setting a column default value
Yes
Yes
/
Yes
/
Yes
Changing the column data type
Yes
Yes
/
No
Requires Online Copy
Yes
Extending VARCHAR column size
(not in PK)
Yes
Yes
/
Varies*
Varies*
Yes
Extending VARCHAR column size
(in PK)
Yes
Yes
/
No
Requires Online Copy
Yes
Dropping a column default value
Yes
Yes
/
Yes
/
Yes
Changing the auto-increment value
Yes
Yes
/
Yes
/
Yes
Making a column NULL
Yes
Yes
/
No
Requires Online Copy
Yes
Making a column NOT NULL
Yes
Yes
/
No
Requires Online Copy
Yes
Modifying ENUM or SET Definition
Yes
Yes
/
Yes
/
Yes

Table Operations

Operation
Syntax Supported
Online Change
Reason for Not Supporting Online Change
Metadata-Only
Data Operation
Permits Concurrent DML
Changing the ROW_FORMAT
No
No
Not support this operation
/
/
/
Changing the KEY_BLOCK_SIZE
No
No
Not support this operation
/
/
/
Setting persistent table statistics
No
No
Not support this operation
/
/
/
Specifying a character set
Yes
Yes
/
No
Requires Online Copy
Yes
Converting a character set
Yes
Yes
/
No
Requires Online Copy
Yes
Optimizing a table
Yes
/
This command returns success immediately but performs no action, as the engine's automatic compaction makes it unnecessary
/
/
/
Rebuilding with the FORCE option
Yes
Yes
/
No
Requires Online Copy
Yes
Performing a null rebuild
No
No
Not support this operation
/
/
/
Renaming a table
Yes
Yes
/
Yes
/
Yes

Partitioning Operations

Operation
Syntax Supported
Online Change
Reason for Not Supporting Online Change
Metadata-Only
Data Operation
Permits Concurrent DML
PARTITION BY
Yes
Yes
/
No
Requires Online Copy
Yes
ADD PARTITION
Yes
Yes
/
Yes
/
Yes
DROP PARTITION
Yes
Yes
/
Yes
/
Yes
DISCARD PARTITION
No
No
Not support this operation
/
/
/
IMPORT PARTITION
No
No
Not support this operation
/
/
/
TRUNCATE PARTITION
Yes
Yes
/
/
Async data deletion
Yes
COALESCE PARTITION
Yes
Yes
/
No
Requires Online Copy
Yes
REORGANIZE PARTITION
Yes
Yes
/
No
Requires Online Copy
Yes
EXCHANGE PARTITION
No
No
Not support this operation
/
/
/
ANALYZE PARTITION
No
No
Not support this operation
/
/
/
CHECK PARTITION
No
No
Not support this operation
/
/
/
OPTIMIZE PARTITION
Yes
/
This command returns success immediately but performs no action, as the engine's automatic compaction makes it unnecessary
/
/
/
REBUILD PARTITION
Yes
Yes
/
No
Requires Online Copy
Yes
REPAIR PARTITION
Yes
No
Not counted as DDL
/
/
/
REMOVE PARTITIONING
Yes
Yes
/
No
Requires Online Copy
Yes
Note:
Global indexes are supported in version 21.6.3.0 and later. For details on how DROP PARTITION and TRUNCATE PARTITION handle global indexes, see Global Index.

Tablespace Operations

Tablespaces operations are not supported.

Generated Column Operations

Generated Column operations are not supported.

Foreign Key Operations

Foreign Key operations are not supported.

Comparison with Community MySQL 8.0

In TDSQL Boundless, both Inplace and Online Copy operations are considered Online operations, as are Instant and Inplace operations in Community Edition MySQL 8.0. The differences between these two sets of operations for common DDL are compared below.
Operation
TDSQL Boundless
MySQL
Converting a character set
Allows concurrent DML
Blocks concurrent DML
Changing the column data type
Allows concurrent DML
Blocks concurrent DML
PARTITION BY
Allows concurrent DML
Blocks concurrent DML
Extending VARCHAR column size
Allows concurrent DML
Support is conditional, with limits on X in VARCHAR(X).
Adding a primary key
Blocks concurrent DML
Allows concurrent DML
Note:
TDSQL Boundless currently does not yet support a small number of DDL operations. Therefore, this section only explains the differences between TDSQL Boundless and the community edition MySQL 8.0 regarding their commonly supported features.
For the Extending VARCHAR column size type, Community Edition MySQL 8.0 imposes a restriction on the character length specified by VARCHAR(X), primarily concerning the storage pack length. Assuming UTF8MB4 is used as the character set, the number of bytes occupied by a field is X * 4.
When a DDL operation is performed, if the current VARCHAR field's X * 4 < 256 and the modified field's Y * 4 < 256, then Inplace is supported.
When a DDL operation is performed, if the current VARCHAR field's X * 4 < 256 but the modified field's Y * 4 >= 256, then Inplace is not supported.
Example:
CREATE TABLE t1(a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(20), ALGORITHM=INPLACE, LOCK=NONE; -- Success
ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(64), ALGORITHM=INPLACE, LOCK=NONE; -- Failed

Online DDL Support for Tables Without Primary Keys

Starting from version 21.6.3.0, Online Copy DDL operations are supported for tables without a primary key. Previously, tables without a primary key could only be processed via Offline DDL, which prevented concurrent read and write operations. The current implementation uses a hidden primary key within the table to perform incremental data sync, enabling tables without a primary key to enjoy the same Online Copy DDL capability as tables with a primary key. Currently, most DDL operations marked as "requiring Online Copy" are supported, including but not limited to:
Modifying a Column Type (such as converting an int column to a bigint column)
Adding/Deleting Columns (Adding a column not at the end of the table)
Reordering Columns
Modifying a Character Set
Attention:
Adding a primary key via Online DDL is not currently supported for tables without a primary key. Furthermore, when performing Online DDL on a partition table without a primary key, you cannot modify the partitioning rules or convert it to or from a non-partition table.
Limit
Description
Converting a table without a primary key to one with a primary key is not supported.
Adding a primary key to a table without a primary key is not supported via Online DDL. For this scenario, Offline DDL is still required.
Partitioning rules of a partition table cannot be changed.
When performing Online Copy DDL on a partition table without a primary key, you cannot modify the partitioning rules (including the number of partitions, partitioning algorithm, and so on).
Mutual conversion between partition tables and non-partition tables is not supported.
Mutual conversion between a partition table without a primary key and a non-partition table without a primary key is not currently supported via Online DDL.

Limitations

TDSQL Boundless currently supports both Preemptive DDL and Non-blocking DDL modes, which are controlled by the tdsql_ddl_block_mode parameter. For details, see tdsql_ddl_block_mode.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan