InnoDB Online DDL Operations with ALGORITHM=INSTANT
You are viewing an old version of this article. View
the current version here.
Currently, the following operations are supported by InnoDB for ALGORITHM=INSTANT
:
- Adding a column. See MDEV-11369 for more information.
- Dropping a column. Added in MariaDB 10.4.0. See MDEV-15562 for more information.
- Changing the order of columns. Added in MariaDB 10.4.0. See MDEV-15562 for more information.
- Increasing the length of
CHAR
orVARCHAR
columns. See MDEV-15563 for more information. - Converting a column from
VARCHAR
toCHAR
, or fromVARBINARY
toBINARY
, or from one integer type to another integer type, as long as the size is greater than or equal to the original size. Added in MariaDB 10.4.3. See MDEV-15563 for more information. - Changing a column from
NOT NULL
toNULL
if theROW_FORMAT
table option is set toREDUNDANT
. Added in MariaDB 10.4.3. See MDEV-15563 for more information. - Altering the
PAGE_COMPRESSED
orPAGE_COMPRESSION_LEVEL
table options. Added in MariaDB 10.3.10. See MDEV-16328 for more information. - Altering the
WITH SYSTEM VERSIONING
table option for a table. Added in MariaDB 10.3.8. See MDEV-16330 for more information. - Dropping a
CHECK
constraint. See MDEV-16331 for more information.
The following will not modify any data files, so that works:
CREATE TABLE t1 (a INT, e ENUM ('red','green')); ALTER TABLE t ADD COLUMN b INT, ALGORITHM=INSTANT;
But the following will modify data files, so an error is thrown when ALGORITHM=INSTANT
is specified:
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER TABLE t DROP INDEX b, ALGORITHM=INSTANT; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER TABLE t ADD INDEX(b), ALGORITHM=INSTANT;
These specific statement would support any other ALGORITHM
option.
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.