- 15.11.1 Overview of Online DDL
- 15.11.2 Performance and Concurrency Considerations for Online DDL
- 15.11.3 SQL Syntax for Online DDL
- 15.11.4 Combining or Separating DDL Statements
- 15.11.5 Examples of Online DDL
- 15.11.6 Implementation Details of Online DDL
- 15.11.7 How Crash Recovery Works with Online DDL
- 15.11.8 Online DDL for Partitioned InnoDB Tables
- 15.11.9 Limitations of Online DDL
The online DDL feature has the following benefits:
It improves responsiveness and availability in busy production environments, where making a table unavailable for minutes or hours whenever you modify its indexes or column definitions is not practical.
It lets you adjust the balance between performance and concurrency during the DDL operation, by choosing whether to block access to the table entirely (
LOCK=EXCLUSIVEclause), allow queries but not DML (
LOCK=SHAREDclause), or allow full query and DML access to the table (
LOCK=NONEclause). When you omit the
LOCKclause or specify
LOCK=DEFAULT, MySQL allows as much concurrency as possible depending on the type of operation.
Performing changes in-place where possible, rather than creating a new copy of the table, avoids temporary increases in disk space usage and I/O overhead associated with copying the table and reconstructing secondary indexes.