Spec-Zone .ru
спецификации, руководства, описания, API
|
You can perform several kinds of online
DDL operations on InnoDB
tables: that is, allowing DML
operations and queries on the table while the
DDL is in progress, performing the operation "in-place" without rebuilding the entire table, or both.
This enhancement 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=EXCLUSIVE
clause), allow queries but not DML (LOCK=SHARED
clause), or allow full
query and DML access to the table (LOCK=NONE
clause). When you omit the
LOCK
clause or specify LOCK=DEFAULT
, MySQL
allows as much concurrency as possible depending on the type of operation.
By doing the changes in-place where possible, rather than creating a new copy of the table, it avoids temporary increases in disk space usage and the I/O overhead of copying the table and reconstructing all the secondary indexes.
MySQL Cluster's NDB
storage engine also supports online table schema changes, but uses its own
syntax that is not compatible with that used for InnoDB
online operations. For more
information, see Section 13.1.7.2, "ALTER TABLE
Online Operations in MySQL Cluster".