這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)碛嘘P(guān)怎么理解MySQL 5.7 Online DDL Overview,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
成都創(chuàng)新互聯(lián)公司服務(wù)項(xiàng)目包括賀州網(wǎng)站建設(shè)、賀州網(wǎng)站制作、賀州網(wǎng)頁制作以及賀州網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,賀州網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到賀州省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
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?”列顯示哪些操作可以重建表。對于使用就地算法的操作,表將就地重建。對于不支持就地算法的操作,使用表復(fù)制方法重新生成表。
“允許并發(fā)DML?”列顯示完全在線執(zhí)行的操作。您可以指定LOCK=NONE來斷言在DDL操作期間允許并發(fā)DML。MySQL在可能的情況下自動(dòng)允許并發(fā)DML。
在所有聯(lián)機(jī)DDL操作期間允許并發(fā)查詢。您可以指定LOCK=SHARED來斷言在DDL操作期間允許并發(fā)查詢。MySQL在可能的情況下自動(dòng)允許并發(fā)查詢。
“注釋”列提供附加信息,并解釋與其他列的“是/否”值相關(guān)的異常和依賴關(guān)系。星號(hào)表示異常或依賴項(xiàng)。
上述就是小編為大家分享的怎么理解MySQL 5.7 Online DDL Overview了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
網(wǎng)站名稱:怎么理解MySQL5.7OnlineDDLOverview
文章位置:http://m.newbst.com/article0/gcsioo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、服務(wù)器托管、微信小程序、ChatGPT、軟件開發(fā)、用戶體驗(yàn)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)