快速辅助索引创建(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. 新创建的辅助索引只包含开始创建时候的记录,只包含当前版本,因此那些在修改索引之前开始的事务,可能无法使用该辅助索引来查询旧的数据



你可能感兴趣的:(MySQL)