快速輔助索引創建(innodb plugin)

記錄備忘

1.創建:

alter table add index.....

innodb先掃描表,根據輔助索引的key列進行排序,然後組織成B樹,由於在填充時分裂,具有很高的fill-factor 


2.刪除:

 Only the internal InnoDB system tables and the MySQL data dictionary tables need to be updated to reflect the fact that the index no longer exists. InnoDB returns the storage used for the index to the tablespace that contained it, so that new indexes or additional table rows may use the space.


3.alter 創建/刪除輔助索引的過程中,在表上加S鎖,因此是可讀的;對於修改聚集索引,則會加X鎖


4. 新創建的輔助索引只包含開始創建時候的記錄,只包含當前版本,因此那些在修改索引之前開始的事務,可能無法使用該輔助索引來查詢舊的數據



發佈了124 篇原創文章 · 獲贊 11 · 訪問量 22萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章