In mySQL 5.6, what is the default behavior of the ALGORITHM parameter?

I am using MySQL 5.6 (and its Online-DDL feature) to generate some in-place table operations like "ADD COLUMN". I see that the LOCK parameter defaults to the highest level of concurrency allowed (for ADD COLUMN it should be "NONE"), but what is the default behavior for the ALGORITHM parameter? The documentation says, "ALGORITHM = DEFAULT is the same as without the ALGORITHM clause." but this is not useful because it does not say that ALGORITHM = DEFAULT is equal.

Somebody knows?


source to share

1 answer

The default depends on which change you are trying to apply.

Some changes may use ALGORITHM = INPLACE, so this is their default. Other changes can never use online DDL, so their default is ALGORITHM = COPY. For example, changing the data type or dropping the primary key is not possible in place.

See . They document how different operations are handled, and the ones that say "No" in the "Inplace" column use ALGORITHM = COPY by default and don't work if you try to use ALGORITHM = INPLACE.

You can force an operation to use ALGORITHM = COPY even if it can do its job in-place, but you cannot request an operation to use ALGORITHM = INPLACE if it cannot.



All Articles