In MySQL 5.6, “Add Columns Add Columns” Without DML Concurrency

MySQL 5.6 claims that DDL operations will be performed with the highest possible concurrency. http://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html

"Allows concurrent DML?" the column shows which operations can be performed completely online; The preferred value is Yes. You can specify LOCK = NONE to state that full concurrency is allowed during DDL, but MySQL automatically allows this level of concurrency whenever possible. If concurrent DML is enabled, concurrent requests are always allowed.

However, I just tried the "ALTER TABLE ADD COLUMN ..." statement, and the table turned out to be locked during this operation. When I repeat the expression and add ", ALGORITHM = inplace, LOCK = none", then it took more time, but the table remained available for use. I thought MySQL would use the highest level of concurrency available for a particular statement, so why should I explicitly specify them?

+4
source share
1 answer

The fact that Online DDL allows for simultaneous DML does not necessarily mean that every feature is required by default.

" concurrency, ", . , MySQL inplace, , : , inplace, . inplace DDL , , , .

, Online DDL . ( , )? , , ALTER 1 , . inplace ALTER , , .

+3

All Articles