怎么理解MySQL 5.7 Online DDL Overview
发表于:2025-11-09 作者:千家信息网编辑
千家信息网最后更新 2025年11月09日,这期内容当中小编将会给大家带来有关怎么理解MySQL 5.7 Online DDL Overview,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。Operation
千家信息网最后更新 2025年11月09日怎么理解MySQL 5.7 Online DDL Overview
这期内容当中小编将会给大家带来有关怎么理解MySQL 5.7 Online DDL Overview,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
| Operation | In-Place? | Rebuilds Table? | Permits Concurrent DML? | Only Modifies Metadata? | Notes |
|---|---|---|---|---|---|
| CREATE INDEX, ADD INDEX | Yes* | No* | Yes | No | Restrictions apply for FULLTEXT indexes; see next row. |
| ADD FULLTEXT INDEX | Yes* | No* | No | No | Adding the first FULLTEXT index rebuilds the table if there is no user-defined FTS_DOC_ID column. Subsequent FULLTEXT indexes may be added on the same table without rebuilding the table. |
| ADD SPATIAL INDEX | Yes | No | No | No | |
| RENAME INDEX | Yes | No | Yes | Yes | Only modifies table metadata. |
| DROP INDEX | Yes | No | Yes | Yes | Only modifies table metadata. |
| OPTIMIZE TABLE | Yes* | Yes | Yes | No | In-place operation is not supported for tables with FULLTEXT indexes. |
| Set column default value | Yes | No | Yes | Yes | Only modifies table metadata. |
| Change auto-incrementvalue | Yes | No | Yes | No* | Modifies a value stored in memory, not the data file. |
| Add foreign key constraint | Yes* | No | Yes | Yes | The INPLACE algorithm is supported when foreign_key_checks is disabled. Otherwise, only theCOPY algorithm is supported. |
| Drop foreign key constraint | Yes | No | Yes | Yes | foreign_key_checks can be enabled or disabled. |
| Rename column | Yes* | No | Yes* | Yes | To permit concurrent DML, keep the same data type and only change the column name.ALGORITHM=INPLACE is not supported for renaming a generated column. |
| Add column | Yes* | Yes* | Yes* | No | Concurrent DML is not permitted when adding an auto-increment column. Data is reorganized substantially, making it an expensive operation. ALGORITHM=INPLACE is supported for adding a virtual generated column but not for adding a stored generated column. Adding a virtual generated column does not require a table rebuild. |
| Drop column | Yes | Yes* | Yes | No | Data is reorganized substantially, making it an expensive operation. ALGORITHM=INPLACE is supported for dropping a generated column. Dropping a virtual generated column does not require a table rebuild. |
| Reorder columns | Yes | Yes | Yes | No | Data is reorganized substantially, making it an expensive operation. |
| Change ROW_FORMATproperty | Yes | Yes | Yes | No | Data is reorganized substantially, making it an expensive operation. |
| Change KEY_BLOCK_SIZEproperty | Yes | Yes | Yes | No | Data is reorganized substantially, making it an expensive operation. |
| Make column NULL | Yes | Yes* | Yes | No | Rebuilds the table in place. Data is reorganized substantially, making it an expensive operation. |
| Make column NOT NULL | Yes* | Yes | Yes | No | Rebuilds the table in place. STRICT_ALL_TABLES or STRICT_TRANS_TABLES SQL_MODE is required for the operation to succeed. The operation fails if the column contains NULL values. The server prohibits changes to foreign key columns that have the potential to cause loss of referential integrity. SeeSection 13.1.8, "ALTER TABLE Syntax". Data is reorganized substantially, making it an expensive operation. |
| Change column data type | No* | Yes | No | No | VARCHAR size may be increased using online ALTER TABLE. See Modifying Column Properties for more information. |
| Add primary key | Yes* | Yes* | Yes | No | Rebuilds 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. |
| Drop primary key and add another | Yes | Yes | Yes | No | Data is reorganized substantially, making it an expensive operation. |
| Drop primary key | No | Yes | No | No | Only ALGORITHM=COPY supports dropping a primary key without adding a new one in the same ALTER TABLE statement. |
| Convert character set | No | Yes* | No | No | Rebuilds the table if the new character encoding is different. |
| Specify character set | No | Yes* | No | No | Rebuilds the table if the new character encoding is different. |
| Rebuild with FORCE option | Yes* | Yes | Yes | No | Uses ALGORITHM=INPLACE. ALGORITHM=INPLACE is not supported for tables with FULLTEXT indexes. |
| "null" rebuild using ALTER TABLE ... ENGINE=INNODB | Yes* | Yes | Yes | No | Uses ALGORITHM=INPLACE. ALGORITHM=INPLACE is not supported for tables with FULLTEXT indexes. |
| Set STATS_PERSISTENT,STATS_AUTO_RECALC,STATS_SAMPLE_PAGESpersistent statistics options | Yes | No | Yes | Yes | Only modifies table metadata. |
| ALTER TABLE … ENCRYPTION | No | Yes | No | Yes | |
| Drop a STORED column | Yes | Yes* | Yes | No | Rebuilds the table in place. |
| Modify STORED column order | Yes | Yes* | Yes | No | Rebuilds the table in place. |
| Add a STORED column | Yes | Yes* | Yes | No | Rebuilds the table in place. |
| Drop a VIRTUAL column | Yes | No | Yes | Yes | |
| Modify VIRTUAL column order | Yes | No | Yes | Yes | |
| Add a VIRTUAL column | Yes | No | Yes | Yes |
此列显示哪些操作允许使用ALGORITHM=INPLACE子句。"Rebuilds Table?"列显示哪些操作可以重建表。对于使用就地算法的操作,表将就地重建。对于不支持就地算法的操作,使用表复制方法重新生成表。
"允许并发DML?"列显示完全在线执行的操作。您可以指定LOCK=NONE来断言在DDL操作期间允许并发DML。MySQL在可能的情况下自动允许并发DML。
在所有联机DDL操作期间允许并发查询。您可以指定LOCK=SHARED来断言在DDL操作期间允许并发查询。MySQL在可能的情况下自动允许并发查询。
"注释"列提供附加信息,并解释与其他列的"是/否"值相关的异常和依赖关系。星号表示异常或依赖项。
上述就是小编为大家分享的怎么理解MySQL 5.7 Online DDL Overview了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注行业资讯频道。
查询
内容
情况
算法
分析
专业
中小
信息
内容丰富
复制方法
子句
就是
文章
方法
星号
更多
此列
注释
知识
篇文章
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
锦州节能软件开发团队
深驰骋网络技术 招聘
plus怎么连接sql数据库
日本网络安全保险保费现状
网络技术人才工作总结
安全的远程登录服务器
君山区网络安全局
access数据库怎么弄照片
服务器电路结构
软件开发招聘问题
网络安全技术岗位要求
与计算机网络技术有关的网页
软件开发概述思维导图
网络安全有哪两方面的含义
oracle数据库记录数
网站数据库更新
良好的软件开发平台
派工单系统数据库
ios软件开发交流网站
导出sql数据库代码
网络安全有什么工作总结
移植数据库最新消息
教务管理系统的数据库指的是什么
如何收集网络安全相关信息
科技监管软件开发
sql数据库如何跨网
与计算机网络技术有关的网页
传奇数据库账号文件
数据库修读两门课程
信息系统网络安全事件应急演练