
Mysql> # Modify the index can be instant if it's a trivial change Mysql> CREATE TABLE t1 (a INT, b INT, KEY(b)) If it can not be done, then server will try INPLACE algorithm and if that can not be supported by SE, server will finally try COPY algorithm. Furthermore, if ALGORITHM is not specified at all, server will first try the DEFAULT=INSTANT algorithm. This can now be achieved by (always) specifying ALGORITHM=INSTANT, this will guarantee that either the operation is done instantly or not at all. Many users have asked us about a way to avoid time consuming schema changes. The DDL is externalized after it completes. If replication was involved, user may have to wait a even longer time for slave to be ready.This steals resources from user transactions. The DDL operation is resource hungry and puts a high demand on CPU, Memory and IO.Disk space requirements will be more than double, roughly the same size as the existing table.For large tables it can take a long time especially in a Replication setup.Up until 8.0 ( see labs release), InnoDB used to add columns to a table by rebuilding the table even for the INPLACE DDL algorithm.

INPLACE DDL is mostly handled by InnoDB while COPY row by row is handled in the server layer. Prior to MySQL 5.6 the only way to do DDL was to COPY the rows one by one. MySQL 5.6 was the first release to support INPLACE DDL. We would like to thank and acknowledge this important and timely contribution by Tencent Games.
MYSQL ADD COLUMN HUGE TABLE PATCH
This INSTANT ADD COLUMN patch was contributed by the Tencent Games DBA Team.

frm files are in an arcane format that is long past its use by date. Prior to MySQL 8.0 the meta-data (data dictionary) was stored in flat files called. The move to a new transactional data dictionary in MySQL 8.0 has made this task a lot easier for us.
MYSQL ADD COLUMN HUGE TABLE SERIES
The ability to add ADD COLUMNs instantly is the first in a series of DDL statements that we plan to do instantly. Developers constantly need to add new columns to meet the constantly changing business requirements. With ever larger and rapidly growing datasets the ability to do DDL instantly is a must have feature in any web scale database. Instant DDL has been one of the most requested InnoDB features for a very long time.
