This is a read-only copy of the MariaDB Knowledgebase generated on 2025-05-01. For the latest, interactive version please visit https://mariadb.com/kb/.

Schema Changes

Overview

In MariaDB Enterprise Server, InnoDB supports many different schema change operations. Many of the operations can be performed online with concurrent DML using little or no locking.

DDL Statements

InnoDB schema changes are performed using the following DDL statements:

About InnoDB Schema Changes and Online DDL

InnoDB schema changes and online DDL are performed with a wide range of statements:

Each operation supports a subset of the following algorithms: INSTANT, NOCOPY, INPLACE, or COPY.

By default, InnoDB will use the most efficient algorithm supported by an operation. This behavior can be changed by using the ALGORITHM clause with the ALTER TABLE statement or by changing the value of the alter_algorithm system variable.

Each operation supports a subset of the following locking strategies: NONE, SHARED, or EXCLUSIVE.

By default, InnoDB will use the most permissive locking strategy supported by an operation. This behavior can be changed by using the LOCK clause with the ALTER TABLE statement.

FeatureDetailResources
Operations support instant algorithmYesInnoDB Schema Changes with the INSTANT Algorithm
Operations support no-copy algorithmYesInnoDB Schema Changes with the NOCOPY Algorithm
Operations support in-place algorithmYesInnoDB Schema Changes with the INPLACE Algorithm
Adding a columnYes
Dropping a columnYes
Reordering columnsYes
Changing a column to NULLYes
Changing a column to NOT NULLYes
Adding a new ENUM optionYes
Adding a new SET optionYes
Adding system versioningYes
Removing system versioningYes
Setting a column's DEFAULTYes
Removing a column's DEFAULTYes
Adding a primary keyYes
Dropping a primary keyYes
Adding an indexYes
Dropping an indexYes
Adding a foreign keyYes
Dropping a foreign keyYes
Setting the next AUTO_INCREMENT valueYes
Setting the row formatYes
Setting the block size for the Compressed row formatYes
Enabling page compressionYes
Setting the page compression levelYes
Disabling page compressionYes
Enabling data-at-rest encryptionYes
Setting the encryption key IDYes
Disabling data-at-rest encryptionYes
Adding a constraintYes
Dropping a constraintYes
Rebuilding the tableYes
Renaming the tableYes
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.