MySQL删除大表时潜在的问题(drop table,truncate table)


来源于:,侵删,纯截图,避免吸引流量之嫌

case1,删除大表时,因为清理自适应hash索引占用的内容导致的MySQL服务挂起


来源:https://keithlan.github.io/2018/03/27/truncate_drop/ 

case2,大表的随意Drop或者truncate导致MySQL服务的挂起

按照本文中的结论就是

MySQL5.6版本以下:使用truncate table + drop table 替代 drop table

MySQL5.6版本+ : 直接使用drop table

On a system with a large InnoDB buffer pool and innodb_adaptive_hash_index enabled, TRUNCATE TABLE operations may cause a temporary drop in system performance due to an LRU scan that occurs when removing an InnoDB table's adaptive hash index entries. The problem was addressed for DROP TABLE in MySQL 5.5.23 (Bug #13704145, Bug #64284) but remains a known issue for TRUNCATE TABLE (Bug #68184).

叶问中的解决办法