• MySQL--DROP TABLE与MySQL版本


    ========================================================================

    DROP TABLE与MySQL版本

    MySQL在5.5版本中引入自适应hash索引,用于提升经常访问的数据页的性能,在删除表时,需要先通过扫描LRU链表找到该表在自适应hash索引使用的数据页,将这些数据从自适应hash索引中删除。如果为MySQL实例配置较多的物理内存,扫描自适应hash索引的LRU链表可能会导致数据库性能异常甚至数据库Crash。
     
    MySQL 5.7版本的官方文档如下描述:
    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).

    对MySQL 5.6之前版本,建议使用TRUNCATE TABLE+DROP TABLE来代替直接DROP TABLE。
    对MySQL 5.6及之后版本,建议直接使用DROP TABLE来删除表。

    参考链接:
    https://dev.mysql.com/doc/refman/5.7/en/truncate-table.html
    https://yq.aliyun.com/articles/570032?spm=a2c4e.11155435.0.0.234e998bdGFhGB
  • 相关阅读:
    mysql学习笔记(七)
    Mysql学习笔记(八)
    vcpkg安装库
    nvm node版本管理工具
    Node.js版本管理工具nvm
    mysql安装后启动及navicat绿色版
    蚁景Web安全12期笔记
    python协程asyncio的个人理解
    EF或原生sql语句使用全文索引
    在拥挤和变化的世界中茁壮成长:C++ 2006–2020
  • 原文地址:https://www.cnblogs.com/gaogao67/p/10390415.html
Copyright © 2020-2023  润新知