我需要从包含列的 MySQL 表中删除大约 400 行:
id - INT(11)
training_id - INT(11)
estimator_blob - LONGBLOB
estimator_blob
的大小为 32 Mb。
看起来像这样的查询:
DELETE FROM estimator WHERE training_id IN (1, 2, ..., 400);
锁定数据库。执行此查询后,所有将结果插入此表的新查询都执行得非常慢。
在数据库状态(mysql> SHOW ENGINE INNODB STATUS;
)我有这个消息:
进程 ID=2600,主线程 ID=139974149678848,状态:强制字典缓存限制
“enforcing dict cache limit”到底是什么意思?是不是这个“锁”的原因?
增加 innodb_buffer_pool_size
没有帮助。
我在具有 70Gb RAM 的机器上使用 MySQL 5.7.19-0ubuntu0.16.04.1。
最佳答案
enforcing dict cache limit
是 InnoDB 进程的后台状态。在此状态下,InnoDB 检查表字典缓存(例如表元数据)内存消耗的使用情况,并在需要时清理字典缓存。
根据 MySQL 开发人员为 bug report 84424 提供的指南:
You have to do several things in order to alleviate the problem:
- increase the additional memory pool
- increase total number of file handles available to MySQL
- increase number of file handles for InnoDB
- improve performance of the I/O on your operating system
您可能需要重新启动服务器才能完全从问题中恢复过来。
关于mysql - 为什么删除许多 BLOB 会锁定状态为 : enforcing dict cache limit? 的 MySQL 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46304613/