12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-12-25 09:55:00
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
Online DDL 是否锁表、是否rebuild表、inplace或copy算法的说明:原文:https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html?spm=5176.100239.blogcon
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
Online DDL 是否锁表、是否rebuild表、inplace或copy算法的说明:
原文:https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html?spm=5176.100239.blogcont64664.13.SpL8lH
OperationCREATE INDEX
,ADD INDEX
Yes*No*YesNoRestrictions apply forFULLTEXT
indexes; see next row.ADD FULLTEXT INDEX
Yes*No*NoNoAdding the firstFULLTEXT
index rebuilds the table if there is no user-definedFTS_DOC_ID
column. SubsequentFULLTEXT
indexes may be added on the same table without rebuilding the table.DROP INDEX
YesNoYesYesOnly modifies table metadata.OPTIMIZE TABLE
Yes*YesYesNoPerformed in-place as of MySQL 5.6.17. In-place operation is not supported for tables withFULLTEXT
indexes.Set column default valueYesNoYesYesOnly modifies table metadata.Changeauto-incrementvalueYesNoYesNo*Modifies a value stored in memory, not the data file.Addforeign key constraintYes*NoYesYesTheINPLACE
algorithm is supported whenforeign_key_checks
is disabled. Otherwise, only theCOPY
algorithm is supported.Dropforeign key constraintYesNoYesYesforeign_key_checks
can be enabled or disabled.Rename columnYesNoYes*YesTo permit concurrent DML, keep the same data type and only change the column name.Add columnYesYesYes*NoConcurrent DML is not permitted when adding anauto-incrementcolumn. Data is reorganized substantially, making it an expensive operation.Drop columnYesYesYesNoData is reorganized substantially, making it an expensive operation.Reorder columnsYesYesYesNoData is reorganized substantially, making it an expensive operation.ChangeROW_FORMAT
propertyYesYesYesNoData is reorganized substantially, making it an expensive operation.ChangeKEY_BLOCK_SIZE
propertyYesYesYesNoData is reorganized substantially, making it an expensive operation.Make columnNULL
YesYes*YesNoRebuilds the table in place. Data is reorganized substantially, making it an expensive operation.Make columnNOT NULL
Yes*Yes*YesNoRebuilds the table in place.STRICT_ALL_TABLES
orSTRICT_TRANS_TABLES
SQL_MODE
is required for the operation to succeed. The operation fails if the column contains NULL values. As of 5.6.7, the server prohibits changes to foreign key columns that have the potential to cause loss of referential integrity. SeeSection13.1.7, “ALTER TABLE Syntax”. Data is reorganized substantially, making it an expensive operation.Change column data typeNoYesNoNoOnly supportsALGORITHM=COPY
Addprimary keyYes*Yes*YesNoRebuilds the table in place. Data is reorganized substantially, making it an expensive operation.ALGORITHM=INPLACE
is not permitted under certain conditions if columns have to be converted toNOT NULL
.Dropprimary keyand add anotherYesYesYesNoData is reorganized substantially, making it an expensive operation.Dropprimary keyNoYesNoNoOnlyALGORITHM=COPY
supports dropping a primary key without adding a new one in the sameALTER TABLE
statement.Convert character setNoYes*NoNoRebuilds the table if the new character encoding is different.Specify character setNoYes*NoNoRebuilds the table if the new character encoding is different.Rebuild withFORCE
optionYes*YesYesNoUsesALGORITHM=INPLACE
as of MySQL 5.6.17.ALGORITHM=INPLACE
is not supported for tables withFULLTEXT
indexes.“null”rebuild usingALTER TABLE ... ENGINE=INNODB
Yes*YesYesNoUsesALGORITHM=INPLACE
as of MySQL 5.6.17.ALGORITHM=INPLACE
is not supported for tables withFULLTEXT
indexes.SetSTATS_PERSISTENT
,STATS_AUTO_RECALC
,STATS_SAMPLE_PAGES
persistent statisticsoptionsYesNoYesYesOnly modifie其余可参考文章:https://yq.aliyun.com/articles/64664
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19